Click here to Skip to main content
15,891,423 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how can i email content of a textbox (Ex) ?
Posted

There is a generic routine here: Sending an Email in C# with or without attachments: generic routine.[^] - it's in C# but it's all straight forward code, so it should translate with Developer Fusion: http://www.developerfusion.com/tools/convert/csharp-to-vb/[^]
 
Share this answer
 
Look at the below code project for sending SMTP mail via VB.NET

Send SMTP mail using VB.NET[^]
 
Share this answer
 
 
Share this answer
 
v2
You need to use the SmtpClient class, something like this

VB
Dim SmtpServer As New SmtpClient()
            Dim mail As New MailMessage()
            SmtpServer.Credentials = New Net.NetworkCredential("yourusername", "yourpassword")
            SmtpServer.Port = 587'used gamil outgoing TSL port here - enter your own
            SmtpServer.Host = "smtp.gmail.com"'used gmail as host - enter your own host
            mail = New MailMessage()
            mail.From = New MailAddress("youremailaddress")
            mail.To.Add("addresstosendto")
            mail.Subject = "Add subject here"
            mail.Body = "add body here"
            SmtpServer.Send(mail)


Hope this helps
 
Share this answer
 
Comments
saeid.piran 6-Mar-12 3:40am    
thank you my friend

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900