How to send and receive e-mails in windows application?
-
I am developing a windows application in VB.Net 2005. In this I want to send mail to my gmail id. And also if I receive mail on my gmail account then it should be displayed in my application. Firstly tell me how to send mail to any e-mail ID through my windows application. In short I want functionality of Outlook Express in my application means in Outlook Express we can configure our gmail or yahoo account in similar way I want to configure my gmail account into my windows application. :confused:Please tell me how to do this?
-
I am developing a windows application in VB.Net 2005. In this I want to send mail to my gmail id. And also if I receive mail on my gmail account then it should be displayed in my application. Firstly tell me how to send mail to any e-mail ID through my windows application. In short I want functionality of Outlook Express in my application means in Outlook Express we can configure our gmail or yahoo account in similar way I want to configure my gmail account into my windows application. :confused:Please tell me how to do this?
study system.web.mail library deeply. it is simple to send mails
Salman Sheikh
-
I am developing a windows application in VB.Net 2005. In this I want to send mail to my gmail id. And also if I receive mail on my gmail account then it should be displayed in my application. Firstly tell me how to send mail to any e-mail ID through my windows application. In short I want functionality of Outlook Express in my application means in Outlook Express we can configure our gmail or yahoo account in similar way I want to configure my gmail account into my windows application. :confused:Please tell me how to do this?
-
hey Steven, i tried the code given by you as follows - Dim myMessage As New System.Net.Mail.MailMessage() With myMessage .To.Add("harshal_shravgi@gmail.com") .From = New System.Net.Mail.MailAddress("harshal_shravgi@yahoo.com", "Harshal") .Subject = "Test For Sending Mail" '.Attachments.Add(New System.Net.Mail.Attachment("path of attachment here")) .Body = "Hi hello How are U?" .IsBodyHtml = False End With Dim SmtpMail As New System.Net.Mail.SmtpClient With SmtpMail .Host = "smtp.gmail.com" .DeliveryMethod = SmtpDeliveryMethod.Network 'Credentials only required if your SMTP server requires User Name and Password .Credentials = New System.Net.NetworkCredential("harshal@veda-logic.com", "board8414") .Send(myMessage) End With But got error as - The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.0 Must issue a STARTTLS command first m34sm543278waf :confused:
-
I did it using my gmail account as follows - Dim myMessage As New System.Net.Mail.MailMessage() With myMessage .To.Add("harshal_shravgi@rediffmail.com") .CC.Add("ashish@veda-logic.com") .From = New System.Net.Mail.MailAddress("harshal.shravgi@gmail.com", "Harshal") .Subject = "Test at " & Now .Attachments.Add(New System.Net.Mail.Attachment("C:\Documents and Settings\x\Desktop\code.txt")) .Body = "Hi hello How are U?" .IsBodyHtml = False End With Dim SmtpMail As New System.Net.Mail.SmtpClient With SmtpMail .Host = "smtp.gmail.com" .DeliveryMethod = SmtpDeliveryMethod.Network .Credentials = New System.Net.NetworkCredential("harshal.shravgi@gmail.com", "pochhi") .EnableSsl = True .Timeout = 10 .Port = 25 .Send(myMessage) End With MessageBox.Show("Message Sent") Now tell me how to receive mails same as we do it in Outlook Express