1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
var WSmtp = G_SMTP;
var WUser = G_USER;
var WMdp = G_MDP;
var WPort = G_PORT;
var objEmail = new ActiveXObject("CDO.Message");
objEmail.From = "adresse@mail";
objEmail.To = WDestinataire;
objEmail.Cc = "";
objEmail.Subject = WObjet; // "HELLO WORLD";
// we are sending a text email. simply switch the comments around to send an html email instead
objEmail.Textbody = WCorps; // objEmail.HTMLBody = "this is the body"
// Send the message using the network (SMTP over the network).
objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2;
//
objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = WSmtp;
// If your server requires outgoing authentication uncomment the lines bleow and use a valid email address and password.
objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 //basic (clear-text) authentication
//Your UserID on the SMTP server
objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") = WUser;
//Your password on the SMTP server
objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = WMdp;
// Port...
objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = WPort;
//Use SSL for the connection (False or True)
objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = false;
objEmail.Configuration.Fields.Update();
objEmail.Send(); |