Per l’invio di email da script in ambiente Windows (per piani Hosting Base e Pro) è necessario utilizzare il seguente codice ASP:

  

<%

On Error Resume Next
Dim strMittente, strDestinatario, strSoggetto, strTesto, strSMTPServer, strSMTPUser, strSMTPPsw
Set objMessage = CreateObject(“CDO.Message”)
 
‘####### VOCI CONFIGURABILI
 
strMittente =  “email@dominio.tld”
strDestinatario =  “email@dominio_destinatario.tld”
strSoggetto =  “oggetto della mail”
strTesto =  “corpo  della mail”
strSMTPServer =  “mail.dominio.tld”
strSMTPUser =  “email@dominio.tld”
strSMTPPsw =  “password”
 
‘####### NON MODIFICARE SOTTO QUESTA RIGA
‘####### ————————————
 
objMessage.Subject = strSoggetto
objMessage.From = strMittente
objMessage.To = strDestinatario
objMessage.TextBody = strTesto
 
objMessage.Configuration.Fields.Item _
(“http://schemas.microsoft.com/cdo/configuration/sendusing”) = 2
objMessage.Configuration.Fields.Item _
(“http://schemas.microsoft.com/cdo/configuration/smtpserver”) = strSMTPServer
objMessage.Configuration.Fields.Item _
(“http://schemas.microsoft.com/cdo/configuration/smtpserverport”) = 25
objMessage.Configuration.Fields.Item _
(“http://schemas.microsoft.com/cdo/configuration/smtpauthenticate”) = 1
objMessage.Configuration.Fields.Item _
(“http://schemas.microsoft.com/cdo/configuration/sendusername”) = strSMTPUser
objMessage.Configuration.Fields.Item _
(“http://schemas.microsoft.com/cdo/configuration/sendpassword”) = strSMTPPsw
 
objMessage.Configuration.Fields.Update
objMessage.Send
 
If Err.Number = 0 Then
Response.Write “Messaggio inviato con successo”
Else
Response.Write “Errore nell’invio del messaggio: ” & Err.Description & “[” & Err.Number & “]”
End If


%>  

Found this article interesting?
Subscribe to DomainRegister´s newsletter!

You can unsubscribe at any time by simply clicking the link in the footer of our emails. For information about our privacy practices, please visit our website.

We use Mailchimp as our marketing platform. By clicking below to subscribe, you acknowledge that your information will be transferred to Mailchimp for processing. Learn more about Mailchimp s privacy practices here.

  • ASP
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

 What is "Dedicated IIS Application pool"?

"IIS application pool" is a Plesk feature, which serves websites and web applications hosted on a...

 How to make public Awstats Web Stats in Plesk

You can access the Web statistics for your site at:http:/yourdomain.com/plesk-stat/webstatThey're...

 Error 500 Internal Server Error: what does it mean?

Your site on Windows hosting gives an "Error 500 - Internal Server Error. There is a problem with...

 How to preview website in Plesk before changing DNS

In Plesk it's possible to preview your site, even if domain DNS are no yet modified and so are...

 How to secure your Plesk control panel with an SSL certificate

Plesk control panel has his own SSL certificate, signed by Plesk, but most browsers do not...