.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

mail sending error

Posted By:      Posted Date: September 20, 2010    Points: 0   Category :ASP.Net

I am getting the following error while trying to send email using System.Net.Mail

Mailbox unavailable. The server response was: Access denied - Invalid HELO name (See RFC2821

i have tried the basic mail sending method but it gives the above error. pls find belwo code used

SmtpClient SmtpServer = new SmtpClient("");
        SmtpServer.DeliveryMethod = SmtpDeliveryMethod.Network;
        System.Net.Mail.MailMessage Mailer = new System.Net.Mail.MailMessage();

                    SmtpClient smtpClient = new SmtpClient();                 
                    Mailer.From = new MailAddress("");
                    Mailer.Subject = "";

View Complete Post

More Related Resource Links

Failure sending mail error in asp.net

Hi I have used gmail for sending mail localy which worked fine but when i uploaded the same file on server the "Failure sending mail." error occured.here is the code i have written:            Dim message As New MailMessage            message.From = New MailAddress("xxx@gmail.com")            message.To.Add(New MailAddress("xxx@yahoo.com"))            message.Subject = test mail""            message.Body = "Hi you have got a test mail from me!            Dim client As New SmtpClient            client.Credentials = New System.Net.NetworkCredential("xxx@gmail.com", "xxxxxxx")            client.Port = 587            client.Host = "smtp.gmail.com"            client.EnableSsl = True            client.Send(message)Pl

Error while sending email using ASP.NET 2.0 -'System.Net.Mail.SmtpException: Failure sending mail


'System.Net.Mail.SmtpException: Failure sending mail. ---> System.IO.IOException: Unable to read data from the transport connection: net_io_connectionclosed.   at System.Net.Mail.SmtpReplyReaderFactory.ProcessRead(Byte[] buffer, Int32 offset, Int32 read, Boolean readLine)   at System.Net.Mail.SmtpReplyReaderFactory.ReadLines(SmtpReplyReader caller, Boolean oneLine)   at System.Net.Mail.SmtpReplyReaderFactory.ReadLine(SmtpReplyReader caller)   at System.Net.Mail.SmtpReplyReader.ReadLine()   at System.Net.Mail.CheckCommand.Send(SmtpConnection conn, String& response)   at System.Net.Mail.MailCommand.Send(SmtpConnection conn, Byte[] command, String from)   at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, SmtpFailedRecipientException& exception)   at System.Net.Mail.SmtpClient.Send(MailMessage message)   --- End of inner exception stack trace ---   at System.Net.Mail.SmtpClient.Send(MailMessage message) 

 i tried many things but still awaiting solution



sometimes  i get this error

 'System.Net.Mail.SmtpException: Failure sending mail. ---> System.Net.WebException: The remote name could not be resolved: 'smtp.mail.y

Getting error after sending E-Mail (ASP.NET)


Hi, everyone!

I have a function in my asp.net page and whenever it is called it is giving me an error :(

"A page can have only one server Form tag" 

It doesn't happen when the page is loaded. only after a button is clicked.

The code is:

void send(object sender, EventArgs e){

   StringBuilder sb=new StringBuilder();

   StringWriter sw= new StringWriter(sb);

   HtmlTextWriter ht=new HtmlTextWriter(sw);


   string bodyMessage=sb.ToString();

   string subject="Testing";

   string emailTo="wjung@xxxx.net";

   string emailFrom="wjung@xxxx.net";

   try { objUtilities.SendEmail(subject,bodyMessage,emailTo,emailFrom); }

   catch (Exception ex) { label1.Text+=ex.ToString();}


I can send and receive E-Mail. but the page shows error.

Please help me, and since I am a newbie to ASP.NET please

instruct me step by step. Thank you!


What is the best method of sending through e-mail and error that is caught with the try, catch, etc


Using VB, VS 2010,  I am wanting a remote web app to send me an e-mail when it finds an error using the try catch.  What is the best way to do that?

SP Outgoing E-Mail Error


Hello Community,

I have a MOSS Server running on Virtual PC.  I have installed and configured MOSS to include incoming and outgoing e-mail.  Incoming e-mail works fine and my lists are receiving e-mail.  My problem is outgoing e-mail.  Right now, any outgoing e-mail produces an error message that is caught by the System Event Viewer, here is the error message:

Event ID: 6857

Description: Cannot connect to SMTP Host

I have checked and rechecked my outgoing e-mail settings and I'm convinced they are correct.  I don't have any firewalls on (it's a virtual development server on a platform that has ant-virus, firewall, etc.).  I have enabled verbose logging for SharePoint Workflow Infrastructure events but the SP Logs only have the same exact message as System Event Viewer.

I've checked out the other posts here and searched the internet as well but no luck.

Any ideas?

Tom Molskow SharePoint Architect - If I solved the issue please propose my reply as the answer - Thanks!

how to embed image in mail body while sending mail in c#.net uisng Exchange2007_SP1.



I am uisng ExchangeVersion.Exchange2007_SP1 EWS to send mail through my c#.net application. I want to embed image in mail body so tht user can see body message along with image in its inbox mail .currently I am uisng image tag to show image but in the email body its just showing image url instead of image.

Error While sending Email using Outlook object in asp.net 4.0


Hi ,

            I am trying to send Email using Outlook object but  it gives following error :

Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80080005 Server execution failed (Exception from HRESULT: 0x80080005 (CO_E_SERVER_EXEC_FAILURE)).

I have added outlook reference "using Microsoft.Office.Interop.Outlook"  version

and i am using below code :

Microsoft.Office.Interop.Outlook.Application oApp = new Microsoft.Office.Interop.Outlook.Application();
            Microsoft.Office.Interop.Outlook._NameSpace oNameSpace = oApp.GetNamespace("MAPI");
            Microsoft.Office.Interop.Outlook.MAPIFolder oOutboxFolder =
            oNameSpace.Logon(null, null, false, false);
            Microsoft.Office.Interop.Outlook._MailItem oMailItem =

Configure incoming e-mail settings - Error File Not Found?

Hello I am trying to setup a test server for SharePoint 2010 and I have followed the MS instructions for deploying a single SharePoint 2010 server with SQL server. I have had no problems or errors during the setup; however now going through the recomended post installation task of configuring incoming email settings I am getting an error message. I have added the SMTP service to the server, configured it in IIS then gone back to the SharePoint central administration page. When I click Configure incoming e-mail settings under System Settings I get the following error message. Error File Not Found. Correlation ID: cc08f335-6762-4c70-a690-ecfd012ec3c2 I have no idea what is causing this so have no way to resolve it, any help would be really appreciated.   Thanks  

Sending an e-mail with the content of a GridView in asp.net 2.0. problem

Hi experts,  I am Sending an e-mail with the content of a GridView in asp.net 2.0. Everything is working fine , but my problem is that  it is also sending "DELETE" LINKLabel to the email. Is there anyway so that only Content of Gridview will go to email and "Delete" Link will not go. Is it possible ??? Thanks in Advance

Database Mail error

Hello I am new to SQL Server 2008. I am upgrading from 2000 to 2008 and currently working on Database Mail. I can send a test mail to say an email address like abc@xyz.com If i create an operator with the above email address, I am getting this error (in Database Mail log) when i send a test mail to Operator.  Message The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 3 (2010-09-07T10:31:24). Exception Message: Cannot send mails to mail server. (A recipient must be specified.). ) Any idea why Database Mail is able to send email when email address is specified and fails to send email to the same address when used in operator? Thank You, V

problem with sending mail by smtpclient

 hi , I have an aspx  page that sending a mail by smtp client , but it`s not work properly ! and pass an exeption : failur sending mail here is my code :   protected void BTN_Submit_Order_Click(object sender, EventArgs e) { MailMessage MailMsg = new MailMessage("Sales@anahidcorp.com", "test0@anahidcorp.com"); MailMsg.Subject = "?????"; MailMsg.Body = "????"; MailMsg.IsBodyHtml = false; MailMsg.BodyEncoding = System.Text.Encoding.Unicode; MailMsg.SubjectEncoding = System.Text.Encoding.Unicode; MailMsg.CC.Add("test1@anahidcorp.com"); MailMsg.CC.Add("test2@anahidcorp.com"); NetworkCredential cred = new NetworkCredential("Sales@anahidcorp.com", "mypass"); SmtpClient smtp = new SmtpClient("myserver"); smtp.UseDefaultCredentials = false; smtp.EnableSsl = true; smtp.Credentials = cred; try { smtp.Send(MailMsg); } catch ( SmtpException ex) { Response.Redirect("errpage.aspx?err=" +

Error on sending Outlook emails

Hi,I am trying to send an email using Outlook in my application. When I run the application in my local machine , it works fine and sends the email using my outlook address. But when I depolyed it onto our server, which is a  Windows Server 2008, it throws an error:Description:            Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80080005.Date/ time:            20100908_03:51:48FullErrorOutput:            System.Runtime.InteropServices.COMException (0x80080005): Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80080005.   at _Default.SendWelcomeEmails(String email)   at _Default.btnGrant_Command(Object sender, CommandEventArgs e)   at System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e)   at System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument)   at System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)   at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)   a

Dynamics Ax report mail subscription error

I created a Dynamics Ax report. In this report some axapta static functions are called. When I run the report in browser it shows data normal. I created for this report email subscription(Setted the execution account).In the email is attached the report in pdf format, but for textboxes where it has to show data with results from axapta functions it shows "#Error". Running the report from link attached in mail shows data normal(Without"#Error"). What can be the solution for this problem?   The error from Event viewer: "The complete data cache has been flushed to request from session 13".      

Mail Send Error

I'm trying to send an email through a form and for some reason it errors when it sends. The only error message I get is "Failure sending mail". I've followed a number of tutorials and I'm guessing I'm missing some sort of configuration. Here is the code which attempts to send mail:try { SmtpClient smtpClient = new SmtpClient(); MailMessage mailMessage = new MailMessage(); MailAddress mailAddress = new MailAddress(fromEmail, name); smtpClient.Host = "localhost"; smtpClient.Port = 4444; mailMessage.From = mailAddress; mailMessage.To.Add(toEmail); mailMessage.Subject = subject; mailMessage.IsBodyHtml = false; mailMessage.Body = message; smtpClient.Send(mailMessage); } catch (Exception ex) { txtPhone.Text = ex.Message; }  Thanks for your help

SSIS Send Mail Task - Failure Sending Mail

Dear all, I have switched off the firewall settings on my system and as suggested im entering the minimal information and data to send the mail. but still the Mail Task is failing.. plz suggest.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend