Copy Source | Copy HTML
- var msg = new ActiveXObject("CDO.Message");
- var fields = msg.Configuration.Fields;
-
- var cdoSendUsingPort = 2;
- var cdoBasic = 1;
-
- fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort;
- fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.gmail.com";
- fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465;
- fields("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = true;
- fields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = cdoBasic;
- fields("http://schemas.microsoft.com/cdo/configuration/sendusername") = "username";
- fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "password";
- fields.Update();
-
- msg.Subject = "CDO test";
- msg.From = "******@gmail.com";
- msg.To = "******@gmail.com";
- msg.TextBody = "CDO test body";
- msg.Send();