Using ASPMailTo use ASPMail, set nEmailServer=nEmailASPMAIL in include/config.asp. The SendEmail function will then execute the following code...// get a mail object
oMail = Server.CreateObject ( "SMTPsvg.Mailer" );
// setup the mail
if ( sFromEmail == "" )
oMail.ReplyTo = 'Anonymous';
else
oMail.ReplyTo = sFromEmail;
// =========================
// important - ASPMail only works if the
// FromAddress is the same domain as
// the RemoteHost domain
// =========================
oMail.FromAddress = 'james@' + sHostDomain;
oMail.RemoteHost = 'mail.' + sHostDomain;
var sEmailList = sToEmail.split ( /[\s;,]/ );
var nEmail;
for ( nEmail in sEmailList )
oMail.AddRecipient ( "", sEmailList [ nEmail ] );
sEmailList = sBccEmail.split ( /[\s;,]/ );
for ( nEmail in sEmailList )
oMail.AddBCC ( "", sEmailList [ nEmail ] );
oMail.Subject = sSubject;
oMail.BodyText = sBody;
// send it
oMail.SendMail ( );
|
Very similar to the JMail component, ASPMail also needs multiple recipients sent into an AddRecipient method individually. Take note of the comment above concerning the FromAddress and RemoteHost properties. I wasted some time tracking down that problem! ASPMail is actually the email system used on CoverYourASP. Part 7: Using ASPEmail... |