5 Oct '14

Shiva Prasad

A collection of source codes that I wrote in VB 6.0, ASP.NET, PHP, C#.NET, VB.NET and JAVA in a course of my career as web developer and software engineer that I would like to share to my fellow programmers. Some of the codes here is not my original work that I found over the Internet and Books while I'm learning how to program. I hope you find my work useful in your learning in programming. Please share my work to other people also who interested to learn the basics of web development and programming. Thank you very much and Happy Productive Programming Everyone.

5 Shares

Sending Mail in ASP.NET

Here we explain how to send mail in ASP.NET. You can implement this code to your ASP.NET projects for mail features. This article will explain how to send mail using Gmail SMTP Server in ASP.Net.  You can download the source code of sending mail application and please add your gmail id and its password to send mail.

Sending Mail in ASP.NET

Sending Mail in ASP.NET

Google may block sign in attempts from some email id’s that do not use modern security standards. It may show some error like, The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required.

To fix this error change the account permission in gmail settings. After login to gmail click on this url: https://www.google.com/settings/security

Even in some cases it shows error if you enable 2 step verification.

Download the project code:

download project code

Kindly replace with your gmail id and password to send the mail. Email ID and password stored in the variables.

Related Posts

  • Default Ports:Server:Authentication:Port:SMTP Server (Outgoing Messages)Non-EncryptedAUTH25 (or 587) Secure (TLS)StartTLS587 Secure (SSL)SSL465POP3 Server (Incoming Messages)Non-EncryptedAUTH110 Secure (SSL)SSL995

    Googlemail – GmailServer:Authentication:Port:SMTP Server (Outgoing Messages)smtp.gmail.comSSL465
    We can send mail from other mail servers …

    Outlook.comServer:Authentication:Port:SMTP Server (Outgoing Messages)smtp.live.comStartTLS587POP3 Server (Incoming Messages)pop3.live.comSSL995

    Office365.comServer:Authentication:Port:SMTP Server (Outgoing Messages)smtp.office365.comStartTLS587POP3 Server (Incoming Messages)outlook.office365.comSSL995 Note: If the above settings are not working for your account, then login to the outlook web app, go to the “Settings” > “Options” > “Account” > “My Account” > “Settings for POP and IMAP Access”.

    Yahoo MailServer:Authentication:Port:SMTP Server (Outgoing Messages)smtp.mail.yahoo.comSSL465POP3 Server (Incoming Messages)pop.mail.yahoo.comSSL995

    Yahoo Mail PlusServer:Authentication:Port:SMTP Server (Outgoing Messages)plus.smtp.mail.yahoo.comSSL465POP3 Server (Incoming Messages)plus.pop.mail.yahoo.comSSL995

    Yahoo UKServer:Authentication:Port:SMTP Server (Outgoing Messages)smtp.mail.yahoo.co.ukSSL465POP3 Server (Incoming Messages)pop.mail.yahoo.co.ukSSL995

    Yahoo DeutschlandServer:Authentication:Port:SMTP Server (Outgoing Messages)smtp.mail.yahoo.comSSL465POP3 Server (Incoming Messages)pop.mail.yahoo.comSSL995

    Yahoo AU/NZServer:Authentication:Port:SMTP Server (Outgoing Messages)smtp.mail.yahoo.com.auSSL465POP3 Server (Incoming Messages)pop.mail.yahoo.com.auSSL995

    O2Server:Authentication:Port:SMTP Server (Outgoing Messages)smtp.o2.ie 25POP3 Server (Incoming Messages)pop3.o2.ie 110

    O2.ukServer:Authentication:Port:SMTP Server (Outgoing Messages)smtp.o2.co.uk 25POP3 Server (Incoming Messages)pop3.o2.co.uk 110

    AT&TServer:Authentication:Port:SMTP Server (Outgoing Messages)smtp.att.yahoo.comSSL465POP3 Server (Incoming Messages)pop.att.yahoo.comSSL995

    NTL @ntlworld.comServer:Authentication:Port:SMTP Server (Outgoing Messages)smtp.ntlworld.comSSL465POP3 Server (Incoming Messages)pop.ntlworld.comSSL995

    BT ConnectServer:Authentication:Port:SMTP Server (Outgoing Messages)pop3.btconnect.com 25POP3 Server (Incoming Messages)mail.btconnect.com 110

    BT OpenworldServer:Authentication:Port:SMTP Server (Outgoing Messages)mail.btopenworld.com 25POP3 Server (Incoming Messages)mail.btopenworld.com 110

    BT InternetServer:Authentication:Port:SMTP Server (Outgoing Messages)mail.btinternet.com 25POP3 Server (Incoming Messages)mail.btinternet.com 110

    OrangeServer:Authentication:Port:SMTP Server (Outgoing Messages)smtp.orange.net 25POP3 Server (Incoming Messages)pop.orange.net 110

    Orange.ukServer:Authentication:Port:SMTP Server (Outgoing Messages)smtp.orange.co.uk 25POP3 Server (Incoming Messages)pop.orange.co.uk 110

    Wanadoo UKServer:Authentication:Port:SMTP Server (Outgoing Messages)smtp.wanadoo.co.uk 25POP3 Server (Incoming Messages)pop.wanadoo.co.uk 110

    HotmailServer:Authentication:Port:SMTP Server (Outgoing Messages)smtp.live.comSSL465POP3 Server (Incoming Messages)pop3.live.comSSL995

    O2 Online DeutschlandServer:Authentication:Port:SMTP Server (Outgoing Messages)mail.o2online.de 25POP3 Server (Incoming Messages)pop.o2online.de 110

    T-Online DeutschlandServer:Authentication:Port:SMTP Server (Outgoing Messages)securesmtp.t-online.deStartTLS587POP3 Server (Incoming Messages)securepop.t-online.deSSL995

    1&1 (1and1)Server:Authentication:Port:SMTP Server (Outgoing Messages)smtp.1and1.comStartTLS587POP3 Server (Incoming Messages)pop.1and1.comSSL995

    1&1 DeutschlandServer:Authentication:Port:SMTP Server (Outgoing Messages)smtp.1und1.deStartTLS587POP3 Server (Incoming Messages)pop.1und1.deSSL995

    ComcastServer:Authentication:Port:SMTP Server (Outgoing Messages)smtp.comcast.net 587POP3 Server (Incoming Messages)mail.comcast.net 110

    VerizonServer:Authentication:Port:SMTP Server (Outgoing Messages)outgoing.verizon.netSSL465POP3 Server (Incoming Messages)incoming.verizon.netSSL995

    Verizon (Yahoo hosted)Server:Authentication:Port:SMTP Server (Outgoing Messages)outgoing.yahoo.verizon.net 587POP3 Server (Incoming Messages)incoming.yahoo.verizon.net 110

    zoho MailServer:Authentication:Port:SMTP Server (Outgoing Messages)smtp.zoho.comSSL465IMAP Server (Incoming Messages)pop.zoho.comSSL995

    Mail.comServer:Authentication:Port:SMTP Server (Outgoing Messages)smtp.mail.comSSL465IMAP Server (Incoming Messages)pop.mail.comSSL995

    GMX.comServer:Authentication:Port:SMTP Server (Outgoing Messages)smtp.gmx.comSSL465IMAP Server (Incoming Messages)pop.gmx.comSSL995

    • indian

      give me full here and i am unable to download from here

      • indian

        give me full code here and i am unable to download from here