Using JMailTo use JMail, set nEmailServer=nEmailJMAIL in include/config.asp. The SendEmail function will then execute the following code...// get a mail object
oMail = Server.CreateObject ( "JMail.SMTPMail" );
// setup the mail
oMail.Silent = true;
oMail.ServerAddress = 'mail.' + sHostDomain;
if ( sFromEmail == "" )
oMail.Sender = oMail.ReplyTo = 'Anonymous';
else
oMail.Sender = oMail.ReplyTo = sFromEmail;
var sEmailList = sToEmail.split ( /[\s;,]/ );
var nEmail;
for ( nEmail in sEmailList )
oMail.AddRecipient ( sEmailList [ nEmail ] );
sEmailList = sBccEmail.split ( /[\s;,]/ );
for ( nEmail in sEmailList )
oMail.AddRecipientBcc ( sEmailList [ nEmail ] );
oMail.Subject = sSubject;
oMail.Body = sBody;
// send it
oMail.Execute ( );
|
Again, very straightfoward code. The main difference from CDONTS is how multiple recipients are handled. JMail requires that the semicolon-separated list is split into an array, then fed into the AddRecipient method one at a time. Part 6: Using ASPMail... |