sent message to mail using vb.net code

Posted by Sekar.C under VB.NET on 3/12/2012 | Points: 10 | Views : 1713 | Status : [Member] | Replies : 5
Hi,
How can sent message to mail using vb.net code
Regard
Sekar.c

Regards
Sekar.c



Responses

Posted by: Hmanjarawala on: 3/12/2012 [Member] Bronze | Points: 25

Up
0
Down
Hi sekar,

Plz give more clarification in your question

Himanshu Manjarawala
Sr. Software Engineer@AutomationAnywhere
http://fieredotnet.wordpress.com/

Sekar.C, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: CGN007 on: 3/12/2012 [Member] Silver | Points: 25

Up
0
Down
Please refer this if u need to send email from VB.NET
http://vb.net-informations.com/communications/vb.net_smtp_mail.htm

Sekar.C, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sekar.C on: 3/12/2012 [Member] Starter | Points: 25

Up
0
Down
User buys the product in online after buy the product this message sent to user mail id
using vb.net


Regards
Sekar.c

Sekar.C, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Hmanjarawala on: 3/12/2012 [Member] Bronze | Points: 25

Up
0
Down
Hi sekar,

Dim client as new SmtpClient("<your-smtp-client>", <port-no>)

Dim mail_msg as new MailMessage()

Dim fromAdd as new MailAddress(tbFrom.Text.Trim()) ''hmanjarawala@yahoo.com

mail_msg.From = fromAdd

mail_msg.To.Add(new MailAddress(tbTo.Text.Trim())) ''hmanjarawala@gmail.com

mail_msg.Subject = tbSubject.Text

mail_msg.IsBodyHtml = True

mail_msg.Body = "Message From: " & tbFrom.Text.Trim() & "Subject:" & tbSubject.Text.Trim() & "Email: " & tbTo.Text.Trim() & "Content: " & tbContent.Text.Trim()



Dim basicCredential as new System.Net.NetworkCredential("hmanjarawala@yahoo.com", "***********")

client.EnableSsl = False

client.UseDefaultCredentials = True

client.Credentials = basicCredential

client.Send(mail_msg)


Himanshu Manjarawala
Sr. Software Engineer@AutomationAnywhere
http://fieredotnet.wordpress.com/

Sekar.C, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sksamantaray on: 3/12/2012 [Member] Silver | Points: 25

Up
0
Down
Hi,
Refer to this link to send mail using vb.net.
keep the mailSend method separately and call when required , passing appropriate parameters.
http://www.aspnetemail.com/tutorials/vsnetVB.aspx
you can also refer to the link provided by CGN007 , provided you want mail should go from a specific gmail id always.



Thanks,
Sanjay

Sekar.C, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response