IT Community - Software Programming, Web Development and Technical Support

How to send email in VB.NET 2005(From Windows Applications)

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


Go Back   IT Community - Software Programming, Web Development and Technical Support > The Lobby > Discussweb HQ

Register FAQ Members List Calendar Mark Forums Read
  1 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 02-21-2008, 04:19 AM
psivakumarmca81 psivakumarmca81 is offline
D-Web Trainee
 
Join Date: Feb 2008
Posts: 4
psivakumarmca81 is on a distinguished road
Default How to send email in VB.NET 2005(From Windows Applications)

I have tried with several codings getting from Net. But none of that has solve my problem. Please help me.

sivakumar.p
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 02-21-2008, 04:56 AM
prasannavigneshr prasannavigneshr is offline
D-Web Incredible
 
Join Date: Feb 2007
Posts: 1,316
prasannavigneshr is on a distinguished road
Send a message via MSN to prasannavigneshr
Thumbs up How to send email in VB.NET 2005(From Windows Applications)

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
If you need more assistance post your code here...

Hope this helpful
__________________
Prasanna Vignesh
MCPD | Web Developer
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-22-2008, 07:33 PM
psivakumarmca81 psivakumarmca81 is offline
D-Web Trainee
 
Join Date: Feb 2008
Posts: 4
psivakumarmca81 is on a distinguished road
Default Re: How to send email in VB.NET 2005(From Windows Applications)

[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
If you need more assistance post your code here...

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.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On

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


All times are GMT -7. The time now is 02:18 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0