Sending email
-
hi everyone, i am trying to sent email from my web application using System.web.mail the problem is i am using different smtp server which reuired authontication. my question is how would i set user name, password and the server. here what i have done but it not working, and i runing this project from my local host. oEmail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1"); oEmail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "abc@ab.com"); oEmail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "******"); SmtpMail.SmtpServer = "smtp.servername.com"; plz help me. i am doing this project for free for some non-profit company and need to finish this project ASAP. Thank you,
-
hi everyone, i am trying to sent email from my web application using System.web.mail the problem is i am using different smtp server which reuired authontication. my question is how would i set user name, password and the server. here what i have done but it not working, and i runing this project from my local host. oEmail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1"); oEmail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "abc@ab.com"); oEmail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "******"); SmtpMail.SmtpServer = "smtp.servername.com"; plz help me. i am doing this project for free for some non-profit company and need to finish this project ASAP. Thank you,
int cdoBasic = 1; int cdoSendUsingPort = 2; if( useAuth ) { msgMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", cdoBasic); msgMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", user); msgMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", pass); msgMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusing", cdoSendUsingPort); msgMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserver", server); msgMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout", 10); msgMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", 25); msgMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpusessl", false); }
-
hi everyone, i am trying to sent email from my web application using System.web.mail the problem is i am using different smtp server which reuired authontication. my question is how would i set user name, password and the server. here what i have done but it not working, and i runing this project from my local host. oEmail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1"); oEmail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "abc@ab.com"); oEmail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "******"); SmtpMail.SmtpServer = "smtp.servername.com"; plz help me. i am doing this project for free for some non-profit company and need to finish this project ASAP. Thank you,
Hi ap_sa, I'm very pleasure to tell you. Now Please try it: MailMessage mm = new MailMessage(); mm.From = "your mail address"; mm.To = "Other mail"; mm.Subject = "mail title"; mm.BodyFormat = MailFormat.Html; mm.BodyEncoding = System.Text.Encoding.Default; mm.Body = "Your mail text"; mm.Fields.Add("http://schemas.microsoft.com/cdo/smtpauthenticate","1"); mm.Fields.Add("http://schemas.microsoft.com/cdo/sendusername","yourname"); mm.Fields.Add("http://schemas.microsoft.com/cdo/sendpassword","yourpwd"); SmtpMail.SmtpServer = "smtp.abc.com"; SmtpMail.Send(mm); OK! The End! Happy you daily! :) ———————————————————————————————————— The Opportunity Knows But Once!