.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 Problem in VB.net

Posted By:      Posted Date: October 25, 2010    Points: 0   Category :ASP.Net

            Dim mail As New MailMessage()           
            mail.From = New MailAddress(FromAddress)
            mail.Subject = subject
            mail.BodyEncoding = System.Text.Encoding.ASCII
            mail.Body = TheBody
            mail.IsBodyHtml = isHTML
            mail.Priority = MailPriority.High           
            Dim smt As New SmtpClient("HostName")
            smt.Credentials = New NetworkCredential("mailid", "password")           

I use the above Code for sending mail but I got the below error..

A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

How to solve this issue...?

It is very urgent.....

View Complete Post

More Related Resource Links

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

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=" +

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.

System.Net.Mail HTML Template Problem


What do I need here ?????? To make this work??

Dim MassMail As New MailMessage()

        Dim Template As ??????????????

        MassMail.To.Add(New MailAddress(TextBox_massemailto.Text))
        MassMail.From = New MailAddress("You@me.com")

        ' MassMail.CC.Add()
        MassMail.Subject = TextBox_massemailsubject.Text
        MassMail.Body = TextBox_massemailBody.Text
        ' MassMail.Body = Template.BodyFileName = "EmailTemplates/BusinessAdBrochure.htm"
        MassMail.Priority = MailPriority.High

        Dim smtpclient As New SmtpClient("relay-hosting.secureserver.net")
        smtpclient.Credentials = New System.Net.NetworkCredential(""You@me.com"", "pasword")
        smtpclient.Port = 25
        smtpclient.EnableSsl = False

Problem to use unicode chars in yahoo mail

Hi i have a problem to send email via smtpClient class to yahoo mail. if i send a unicode email from non-Yahoo account to yahoo mail, it works correctly (display unicode chars correctly without any making change), but when i send from yahoo account to yahoo mail, it does not display characters correctly and i should change it's encoding to UTF8. can anybody help me to work-around this problem ? Please see my previous thread in this link. thanks in advancehttp://www.codeproject.com/KB/codegen/DatabaseHelper.aspx

Problem with incoming mail to SharePoint Library - what is wrong with this?

I configured my incoming mail to a SharePoint 2010 library according to these instructions. http://intellects.in/2010/04/04/configuring-sharepoint-2010-document-libraries-with-exchange-server-2010-to-receive-mails-from-internalexternal-world/ I'm able to receive mail at the Exchange mailbox set up for the document library, but am unable to receive the document in the library itself.  I'm thinking it's because I have a problem with my naming - but I'm not sure how to solve it: I have a SharePoint box and an Exchange box. I've configured the SMTP virtual server with default domain of  server.domain.com .  I've also assigned it an alias of domain2.net I've configured incoming email in SharePoint Central Administration to use the address of mylist@domain2.net so that users can have a friendly url for sending documents to lists and libraries. I've created an Attended Domain in Exchange 2010 and set up an email address policy that speicifes all mailboxes receive an domain2.net address.  I have an MX record for the domain2.net address with a DNS server pointing to the Exchange box. I've created an SMTP Send Connector that points to the FQDN server.domain.com of my virtual server on my SharePoint box. With that connector, I've chosen to route mail through the same FQDN of server.domain.com , that of my SharePoint/IIS SMTP Virtual Server box. When I confi

problem in sms sending

I am using asp.net for sending sms through sms gate way and code like is like this public string readHtmlPage(string mobileNumber, string messageText, string sturl)        {            //String result = "";            //String strPost = "username=_sms&password=153&sender=msm-ig&cdmasender=mycdmasenderid&to=" + mobileNumber + "&message=" + messageText + "";            String result = "";            String strPost = "user=5&pwd=2sg&senderid=TM-D&mobileno=" + mobileNumber + "&msgtext=" + messageText + "";            StreamWriter myWriter = null;            HttpWebRequest objRequest = (HttpWebRequest)WebRequest.Create(sturl);            //add Proxy info if required            //objRequest.Proxy = WebProxy.GetDefaultProxy();            //objRequest.

SSIS 2005 - Send Mail Task - signature appended to email is garbled - unicode problem?

Hi, I'm pretty new to SSIS so go easy on me. I have a Send Mail Task to notify if a file cannot be imported - the mailbody is created on the previous step by a VB.NET script task to include the name of the file and the path it's been archived to. The problem I'm having is that while the body of the email I've created is displaying fine, our company's Exchange server appends a signature to all emails, and this is coming up as undisplayable characters, presumably due to some kind of unicode encoding problem. I've tried casting the email body in an expression to DT_STR (doesn't work as DT_STR "cannot be converted to a supported type" which seems a bit odd but never mind), DT_WSTR (garbled signature), DT_TEXT/DT_NTEXT (strange error on this one - "Attempted to read or write protected memory") none of those ideas worked, and I'm a bit stumped now. Can anyone help? I'm using SSIS 2005 with SP3

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

Sending Array of Custom Class over WCF Problem

I have been attempting to convert some service calls that returned a DataSet into something more lightweight. For instance, I am converting: [OperationContract] public DataSet GetCommittees(); into: [OperationContract] public List<VolunteerCommittee> GetCommittees(); where committee is defined as: [DataContract] public class VolunteerCommittee { [DataMember] public int Id { get; set; } [DataMember] public String Name { get; set; } } I copied the structure of the data contract and the operation contract right from an example in a book I bought on WCF. The author mentioned that the List<VolunteerCommittee> would get converted into an array over the wire, so the client's operation contract looks like: [OperationContract] public VolunteerCommittee[] GetCommittees(); My problem: When the service is called, an empty array is returned every time. When I put trace statements in, I see an array of 48 VolunteerCommittees leaving the server. I've done some reading on the problem and tried a number of suggestions, such as using the XmlSerializer attribute, including a certain namespace as a [return:] on the server's contract, changing the type of binding (it's using wsHttpBinding... I tried basicHttpBinding) and turning off MTOM in the behavior, but none of these changed the empty result of the call. At this point, I'm hoping someone can shine some light on

System.Net.Mail e-mail header info problem

I'm new to using the system.net.mail class and I'm having trouble with a small program I'm writing.  I use my SendMessage() to send an email public static void SendMessage(string msg)         {             System.IO.File.Copy(mySource + msg, destSource + msg);             MailMessage mail = new MailMessage("from@me.com", "to@you.com, msg, "");                        Attachment attch = new Attachment(destSource + msg, "text/plain; format=flowed;reply-type=original"); //content-type text/plain                                   mail.Attachments.Add(attch);                                  MessagingCenter.client.Send(mail);             mail.Dispose();         } However, the email sent

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        
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