Click here to Skip to main content
15,888,046 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to send a email on my application using VB.NET(using imports system.web.mail).

my requirement is I can use any mail account to send a email to any mail address.

for example:
I use host: abc.com.vn
my mail:
from tea@yahoo.com.vn
To: tea12abc.com.vn
subject: tesst send mail
body: hello tea.

I hope that everybody will help me resolve this problem
thanks.
Posted

See here[^].

If you do a search on the internet, you will find more information.
 
Share this answer
 
..try this one
this is a Mail Component for .NET
here:
http://www.rebex.net/mail.net/
 
Share this answer
 
Hi To send email in VB.NET,

Imports System.Web.Mail

You can call the Send method in two ways.

1. By passing MailMessage as a parameter


VB
public static void Send(MailMessage).
Here MailMessage is a class.
Private mailMsg As MailMessage = New MailMessage()
Private mailMsg.From = from@fromServer.com
Private mailMsg.To = to@toServer.com
Private mailMsg.Cc = cc@ccServer.com"
Private mailMsg.Bcc = bcc@bccServer.com
Private mailMsg.Subject = "SubjectOfTheMailString"
Private mailMsg.Body = "BodyOfTheMailString"
SmtpMail.Send(mailMsg).

2. Direct method.

VB
public static void Send(String from, String to, String subject, String messageText).


Example:
VB
SmtpMail.Send("mcb@abc.com", "webmaster@def.com", "Subject", "Message body").

Regards
Sreyas MN
 
Share this answer
 
v2
Comments
Simon_Whale 14-Dec-10 5:11am    
edited for code blocks better reading, best to put code inside <pre> </pre> tags
I search on internet but I didn't find.code on internet only guide the way to send a email when we use our email and domain are the same
example:
I use host: abc.com.vn
my mail:
from tea12@abc.com.vn
To: tea@yahoo.com.vn
subject: tesst send mail
body: hello tea.

the seanding as above is ok
 
Share this answer
 
Comments
Indivara 12-Dec-10 21:06pm    
Please don't add answers in reply to previous answers. For one thing, there won't be any mail notification, and it doesn't make sense.
Anyway what's wrong with the method given in Abhinav's answer above?

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