Skip to main content

Posts

Showing posts from January, 2014

Unable to send email using SMTP Server (Failure sending mail error)

You can configure the SMTP server or can use Gmail SMTP to send email. But sometime you face the error read as ‘Failure sending mail.’ , though you have added correct configuration and code to send email is correct. And then you wonder what went wrong due to which email not sent to recipient. Exception Detail and Reason: If you check the exception details then it read like: An attempt was made to access a socket in a way forbidden by its access permissions 173.194.79.108:587 This issue may be due to firewall or Antivirus blocking your port to send mail. Solution: Disable Firewall or Antivirus which is blocking port to send mail.  If you are using McAfee then unblock McAfee port blocking for outgoing SMTP mail as mentioned below: ·          Go to system tray and right click on McAfee icon and select VirusScan Console ·          Right click on Access Protection and select Properties. ·          Go to Anti-virus Standard Protection and uncheck the Block check a

How to Send email in ASP.Net and C# using Gmail SMTP Server

If you want to add functionality of sending email for your ASP.Net web application one way is to configure your own SMTP (for large application, companies configure their own mail server), however if you have not access to any SMTP server, don’t worry Google is there to rescue the things. You can send email through Gmail SMTP Mail Server; for this you just need to use an email address and password of a valid Gmail account and the Gmail SMTP Mail Server settings. In this article I will explain how to send email in ASP.Net using Gmail SMTP Server. Before proceeding further let’s understand the required MailMessage Class Properties: Property Description From Email address of Sender To Email Address of Recipient(s) CC Carbon Copies Email addresses (if any) BCC Blind Carbon Copies Email addresses (if any) Subject Subject of the Email IsBodyHtml