How to send email from Yahoo, Gmail, Hotmail using C# and VB.Net in ASP.Net

Last Reply 4 months ago By dharmendr

Posted 4 months ago

Hello,


I know that there are too many questions and answers regarding how to send email. However, I come to you guys looking for your recommended solution. Could you please point me to the best solution that you know is good to send email via yahoo, gmail and hotmail?

Thank you in advance. 

Posted 4 months ago Modified on 4 months ago

Hi power,

Refer the below article.

How to send email with attachment in ASP.Net

For Gmail:

For gmail below is the smtp.Host and smtp.Port

C#

smtp.Host = "smtp.gmail.com";
smtp.Port = 587;

VB.Net

smtp.Host = "smtp.gmail.com"
smtp.Port = 587

For Yahoomail:

For yahoomail below is the smtp.Host and smtp.Port

C#

smtpClient.Host = "smtp.yahoo.com"; // or smtp.mail.yahoo.com
smtpClient.Port = 465; //or 995

VB.Net

smtp.Host = "smtp.yahoo.com" ' or smtp.mail.yahoo.com
smtp.Port = 465 ' or 995

For Hotmail:

For hotmail below is the smtp.Host and smtp.Port

C#

smtp.Host = "smtp.live.com";
smtp.Port = 25;

VB.Net

smtp.Host = "smtp.live.com"
smtp.Port = 25
I agree, here is the link: https://www.e-iceblue.com/Introduce/spire-office-for-net-free.html?aff_id=108