.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

Database Mail Not Sending Mail ?

Posted By:      Posted Date: May 22, 2011    Points: 0   Category :

Dear Sir,

To Send Mail Using Database Mail from SQL Server 2005 SP3, I have performed following steps.

  1. In Surface Area Configuration for Features I have Selected Enable Database Mail Stored Procedure.
  2. From SQL Server Management Studio, I have Created Mail Account & Profile & Tried to Send Test Mail but It is not sending.
  3. I checked Database Mail Log then it displays following message.

The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 3 (2011-05-17T15:30:45). Exception Message: Cannot send mails to mail server. (The operation has timed out.).

I also tried by change System Parameters in Mail Profile but It fails.

Please help me to solve this problem.

Sanjay Shah

View Complete Post

More Related Resource Links

SQL and Outlook: Enable Database Access and Updates Through Exchange and Any E-mail Client


Using Microsoft technologies, you can insert, edit, query, and delete database entries using any e-mail client such as Hotmail, Outlook, Yahoo, or even WAP phone. While e-mail is certainly a powerful and widely used tool, it is usually not integrated with an application for performing any tasks other than sending reminders. The application scenario described here, an e-mail-based SQL update program, uses a simple data model; however, this solution will apply to any data model that you are working with. It will also eliminate the need for complex n-tier Internet applications and serves as a low maintenance solution for providing data access.

Alok Mehta and Daniel Williams

MSDN Magazine January 2002

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.

Modify Subject line of Notification e-mails sent by Database Mail

Hello All, I am using database mail for SQL Server Agent Job notification.  It is working just great. However the e-mails that I receive have a specific format of subject line as below. SQL Server Job System: 'TEST' completed on \\Server_Name I wanted to see if I can modify this to send e-mails with this subject line. SQL Server Job System: 'TEST' completed on <Server_Name> Is this possible?  If so can someone help me with the steps? Thanks.

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

Database Mail configuring the maximum mail size (not attachment 'MaxFileSize')

Hi can anyone tell me if it's possible to configure the maximum size of an email when using database mail?  I know it's possible to use sysmail_configure_sp to set 'MaxFileSize', I want to prevent an email being sent the size of the body of the email is very large. In my case the body is based on a query result set inserted as html. 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=" +

Mail data is truncated in Database mail

I have sent mail using Database mail...But I am getting only part of data in mail... The mail size remaining same. 8kb Is there is any limitation on mail size???Cheers...vaibhav

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.

SSIS Send Mail Task - Failure Sending Mail

Hi Everyone, Hopefully someone out there will have an idea as this is driving me nuts. I've setup a task to email on success/failure and keep receiving the following message when executed: Progress: The SendMail task is initiated. - 0 percent complete[Send Mail Task] Error: An error occurred with the following error message: "Failure sending mail.". Progress: The SendMail task is completed. - 100 percent completeTask Send Mail Task failed When I configure Outlook Express on the same machine with the same settings it works. On the SMTP Connection Manager I have left the default name, tested with both an IP address and Server Name, and no authentication or SSL. On the Send Mail Task, it uses the above connection. The To: , From: , Subject  fields are populated. Message SourceType is DirectInput, MessageSource is Test, Priority is Normal and no attachments or expressions etc. Nothing useful is logged in the Event Viewer even with full logging turned on. Any suggestions appreciated, Thanks.

Sending a Mail Message to Multiple Addresses Using System.Net.Mail

 VWD 2008 Express.  Visual Basic. I use the following routine (XXXXX have replaced sensitive data) to try to send an email message to mutiple email addresses.  It only sends to the first email address in the comma-delimited list.  How can I send the message to multiple email addresses?  Thanks for the help. Protected Sub SendButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles SendButton.Click 'Send the message to all users who have emails. Dim smtpClient As SmtpClient = New SmtpClient() Dim message As MailMessage = New MailMessage() Dim Success As Boolean, I As Integer, strTO As String = "" Try 'Gather all user email addresses Dim strSQL = "SELECT EMail from aspnet_membership where Email<>''" Dim MyDataset As DataSet = GetDataSet(strSQL, Success) I = 0 For Each dr As DataRow In MyDataset.Tables(0).Rows If I = MyDataset.Tables(0).Rows.Count - 1 Then strTO = strTO + dr("Email") Else strTO = strTO + dr("Email") + "," End If I = I + 1 Next Dim toAddress As New MailAddress(strTO, "To All Users") 'Ga

Sending mail to Faxnumber - Urgent

Hello Everyone i have been trying to resolve issue since few days but no luck I am trying to send an email to a faxnumber. I am not using as FAXCOMLib  because we don't have a modem or fax line attached to our server. I am using GFI fax maker where i am sending email where it converts email to fax number and send fax. When i use CDO.Message and send mail to a regular email its sends it with no issues but when i use faxnumber@faxmaker.com it doesn't send the mail instead creates  error "Delivery to the following recipients failed" in inetput\mailroot\badmail   When i spoke to my N/w persom he says i should put square bracketts [faxnumber@faxmaker.com] and then send it because then Gfifaxmaker understands that as fax and sends fax Can please someone help me how to put square bracketts without outlook or SMTP server validating the address and send it Please someone hlep Appreicate your'e time and help Thank you very much        

'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)   at crmpark.bemail.sendemail(String toemail, String frmemail, String bcc, String cc, String strattach, String Subject, String bmessage) in    getting the above error when sending mail from asp.net 2.0

Sending email System.net.mail


Ok here's my problem. I have a contact page with a txtbox for users name, email and message for users to contact me.  When I send the message it goes through, but the senders email is always my email. Even though i have set it to the txtEmail.Text property. So when I reply, it sends me an email. What am I not seeing that I messed up. Also this is running from VS 2005.

                 protected void btnSubmit_Click1(object sender, ImageClickEventArgs e)

                 const string toAddress = "myemail@gmail.com";
                    MailAddress from = new MailAddress(txtEmail.Text, txtName.Text);
			        MailAddress to = new MailAddress(toAddress, "Admin");
			        MailMessage message = new MailMessage(from, to);

			        // set properties
			        message.Subject = txtName.Text + " has sent you an email!";
			        message.Body = txtMessage.Text;
                                message.IsBodyHtml = false;

			        //create smtp object
			        SmtpClient client = new SmtpClient();
                               client.EnableSsl = true;

                    catch(Exception ex)
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