Hello,I have the following web mail code, which works fine and delivers to my personal email and office mail, however it fails to deliver to yahoo and hotmail and doesnt even show up in the junk mail folders.What could be wrong here. The smtp details are correct and its hosted on a remote server.What is wrong here ?thanks Here is my code.1st I have a class file, below which has the new_signup_sendmail using System.Net.Mail;/// <summary>/// Summary description for new_signup_sendmail/// </summary>public class new_signup_sendmail{ public new_signup_sendmail(string from1, string to1, string bcc1, string cc1, string subject1, string body1) //( from , to, bcc, cc, subject, body) { try { MailMessage NewEmail = new MailMessage(); NewEmail.From = new MailAddress(from1); NewEmail.To.Add(new MailAddress(to1)); { NewEmail.Bcc.Add(new MailAddress(bcc1)); } if ((cc1 != null) && (cc1 != string.Empty)) { NewEmail.CC.Add(new MailAddress(cc1)); } NewEmail.Subject = subject1; NewEmail.Body = body1; NewEmail.IsBodyHtml = true; SmtpClient mSmtpClient = new SmtpClient(); // Send the mail message mSmtpClient.Send(NewEmail); //this.Label1.Text = "Email sent successful."; } catch { // this.Label1.Text = "Email sent failed"; } }}
Then I have the button1_click event here protected void Button1_Click(object sender, EventArgs e) { string from1 = "info@something.com";// like username@server.com string to1 = To.Text; //your To Mail string bcc1 = ""; string cc1 = ""; string subject1 = Subject.Text; string body1 = Body.Text; new_signup_sendmail send_mail = new new_signup_sendmail(from1, to1, bcc1, cc1, subject1, body1); }
and i have the code in my web.config file. email is Edited <system.net> <mailSettings> <smtp> <network host="mail.something.com" port="25" userName="info@something.com" password="123456"/> </smtp> </mailSettings> </system.net>