Hi,
I am not able to send email with the send email action. I tried to do a little application in c# and it's working fine.
Here is the code :
MailMessage msg = new MailMessage();
msg.From = "email1@wonderware.com";
msg.To = "eamil1@wonderware.com";
msg.Subject = "tes";
msg.Body = "klklk";
msg.BodyFormat = MailFormat.Text; // can be MailFormat.HTML
/* you can ignore following line for encoding, .NET will use your PC default text encoding */
//msg.BodyEncoding = System.Text.Encoding.GetEncoding("iso-8859-2");
/* if you need attachment */
MailAttachment ma = new System.Web.Mail.MailAttachment("c:\\doc\\test.txt");
msg.Attachments.Add(ma);
/* end attachment* section */
msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "2"); //basic authentication
msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "Username");//this.username.Text); //set your username here
msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "Password");//this.password.Text); //set your password here
msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", "25");
// - smtp.gmail.com use STARTTLS (some call this SSL)
//msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpusessl", "true");
SmtpMail.SmtpServer = "SMTP Server"; //assign smtp server here
SmtpMail.Send(msg); //this line actually fire the msg out
There is something in the configuration the smtp.authenticate that is set to 2.. else it is not working. Should this be the problem that i have?
Thank you,
Alexis