Last post Feb 27, 2018 06:39 AM by Cathy Zou
Feb 26, 2018 10:05 AM|qsoft_developer|LINK
I am building a new website for my company. At the moment we are using static website and I would like to convert it all to ASP.NET.
I have designed a nice bootstrap form, however I am having trouble with the contact us form.
In my old website I userd asp and the following object:
Set Mail = Server.CreateObject("Persits.MailSender")
I tried implementing the following code:
However, I don't want to use a real 'from' email like this:
var smtp = new System.Net.Mail.SmtpClient();
smtp.Host = "smtp.gmail.com";
smtp.Port = 587;
smtp.EnableSsl = true;
smtp.DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.Network;
smtp.Credentials = new NetworkCredential(fromAddress, fromPassword);
smtp.Timeout = 20000;
I just want to use the mail address that the viewer filled in the form, just I like I do now:
Mail.port = "25"
Mail.From = Request("email") ' From address
Mail.FromName = Request("first_name") & Request("last_name")' From Name
Is there a way to use the asp Persits.MailSender object with .net? Or maybe is there another simple solution?
Feb 27, 2018 06:39 AM|Cathy Zou|LINK
In Following article I will explain how to send email using Gmail SMTP Server in ASP.Net. To send email with Gmail SMTP Server, you will need to use an email address and password of a valid Gmail account and along with that you will need the Gmail SMTP Mail