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 Utenti hanno trovato utile questa risposta
Hai trovato utile questa risposta?

Articoli Correlati

 What is "Dedicated IIS Application pool"?

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

 Come rendere pubbliche le statistiche di navigazione Awstats in Plesk

Le statistiche di navigazione Awstat del tuo sito sono disponibili al seguente...

 Perché ottengo l’errore “500 – Internal server error” ?

Può capitare che un sito su hosting Windows restituisca il seguente messaggio d’errore:...

 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...