How do I add SMTP Authentication in my scripts
This is different for each type of mailing component, below is the code you need to add to your scripts.
No longer supported, use ASPEmail 5, to change to ASPMail 5 from ASPMail, in your script do the following:
Find: Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
Replace with: Set Mailer = Server.CreateObject("Persits.MailSender")
Find the line of code that contains the Mail Server Host address ie Mailer.Host = yourHost or yourHost = for example. then on the next line add:
Mail.Username = "firstname.lastname@example.org"
Mail.Password = "Your-email-login-password"
This will fix the problem for ASPEmail 5.
JMail Pro 4.5:
Add the following code to your mailer script:
Message.MailServerUserName = "email@example.com"
Message.MailServerPassword = "Your-email-login-password"
This will fix the problem for Jmail.
For CDOSYS, this is a little bit more complex, see https://portal.cyberhostpro.com/knowledgebase/64/Example-CDOSYS-Script.html for an example script including Authentication.
PHPMail is not supported on Windows, however you can use a PHP SMTP script which will work, see https://portal.cyberhostpro.com/support/index.php?/Knowledgebase/Article/View/100/0/php-mail-script-with-smtp-authentication
For PHPMailer scripts try editing your script to add the SMTP options like below:
$mail = new PHPMailer();
$mail->IsSMTP(); // send via SMTP
$mail->Host = "mail.your-domain"; // SMTP servers
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = you@your-domain; // SMTP username
$mail->Password = "POP3-Password"; // SMTP password
$mail->Port = 25;