This is a discussion on How to send email in VB.NET 2005(From Windows Applications) within the Discussweb HQ forums, part of the The Lobby category; I have tried with several codings getting from Net. But none of that has solve my problem. Please help me. ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| Hi sivakumar, Welcome to Discussweb IT Community, Sending a email using ASP.NET 2.0 and VB.NET is actually very simple. First, you will need to import the System.Net.Mail namespace. The System.Net.Mail namespace contains the SmtpClient and MailMessage Classes that we need in order to send the email. Use the btnSubmit_Click event to do the work. Code: Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmit.Click Try Dim message As New MailMessage(ToAddress, From Address, Subject, Message) Dim emailClient As New SmtpClient(your SMTP Server Address) \\ smtp.gmail.com emailClient.Send(message) Catch ex As Exception End Try End Sub Hope this helpful |
| |||
| [quote=prasannavigneshr;22875]Hi sivakumar, Welcome to Discussweb IT Community, Sending a email using ASP.NET 2.0 and VB.NET is actually very simple. First, you will need to import the System.Net.Mail namespace. The System.Net.Mail namespace contains the SmtpClient and MailMessage Classes that we need in order to send the email. Use the btnSubmit_Click event to do the work. Code: Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmit.Click Try Dim message As New MailMessage(ToAddress, From Address, Subject, Message) Dim emailClient As New SmtpClient(your SMTP Server Address) \\ smtp.gmail.com emailClient.Send(message) Catch ex As Exception End Try End Sub Actually, i have tried with the above code but still i have an error. I want to send the mail with smtp authentication. I think in our smtp server this rights have been restricted. I don't know about the server restrictions. Kindly help needed prasanna. Thank you. |
![]() |
| Thread Tools | |
| Display Modes | |
| |
LinkBacks (?)
LinkBack to this Thread: http://www.discussweb.com/discussweb-hq/5305-how-send-email-vb-net-2005-windows-applications.html | |||
| Posted By | For | Type | Date |
| DiscussWeb IT Community - Technical Support and Technology Discussions | This thread | Refback | 02-26-2008 03:55 AM |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to send email in VB.NET 2005(From Windows Applications) | psivakumarmca81 | VB.NET Programming | 2 | 02-24-2008 06:20 PM |
| Practical issues when we develop code in Windows Forms in C#.Net 2005 | Sathish Kumar | C# Programming | 10 | 09-20-2007 06:17 AM |
| Email Send Using MYSQL or Oracle | sivaramakrishnan | Database Support | 1 | 08-08-2007 02:39 AM |
| How to convert a SMS message in to Email in Windows mobile? | theone | Mobile Software Development | 1 | 07-24-2007 10:41 PM |
| How to Send Email from a PHP Script Using SMTP Authentication? | Sabari | PHP Programming | 1 | 07-20-2007 04:42 AM |