You must Sign In to post a response.
  • Category: Windows 8

    Contact form send email

    I am creating website in in i want to send message using email in contact it is possible...
    Thank you
  • #769992

    Here's the Article I have written a few years ago it will help you please check.

    Thanks and Regards
    Miss Meetu Choudhary (Site Coordinator)
    Go Green Save Green

  • #769993
    when i check the above link and i got the erorr like System.Net.Mail.SmtpException: Failure sending mail. ---> System.NullReferenceException: Object reference not set to an instance of an object. at System.Net.BufferBuilder.Append(String value) at System.Net.Mail.AuthCommand.PrepareCommand(SmtpConnection conn, String message) at System.Net.Mail.AuthCommand.Send(SmtpConnection conn, String message) at System.Net.Mail.SmtpConnection.GetConnection(String host, Int32 port) at System.Net.Mail.SmtpTransport.GetConnection(String host, Int32 port) at System.Net.Mail.SmtpClient.GetConnection() at System.Net.Mail.SmtpClient.Send(MailMessage message) --- End of inner exception stack trace --- at System.Net.Mail.SmtpClient.Send(MailMessage message) at contactus.btnSend_Click(Object sender, EventArgs e) in d:\website\contactus.aspx.cs:line 143

  • #769994
    This code is definitely working i have tried and tested. kindly make sure you have all required reference files in place.
    Thanks and Regards
    Miss Meetu Choudhary (Site Coordinator)
    Go Green Save Green

  • #770025

    Can you try this code

    MailMessage message = new MailMessage();
    SmtpClient smtp = new SmtpClient();
    message.From = new MailAddress("FromMailAddress");
    message.To.Add(new MailAddress("ToMailAddress"));
    message.Subject = "Test";
    message.IsBodyHtml = true; //to make message body as html
    message.Body = htmlString;
    smtp.Port = 587;
    smtp.Host = ""; //for gmail host
    smtp.EnableSsl = true;
    smtp.UseDefaultCredentials = false;
    smtp.Credentials = new NetworkCredential("", "password");
    smtp.DeliveryMethod = SmtpDeliveryMethod.Network;

    Name : Dotnet Developer-2015
    Email Id :

    'Not by might nor by power, but by my Spirit,' says the LORD Almighty.

  • Sign In to post your comments