Sending Mail via SMTP

  • Thread starter Thread starter MadCrazyNewbie
  • Start date Start date
M

MadCrazyNewbie

Hey group,

Could anybody point me in the right direction for some hows to`s on how to
send e-mail from VB?

Basically want a form with 3 x textbox's on 1 for From, 1 for subject, and 1
for message.

Many Thanks
MCN
 
* "MadCrazyNewbie said:
Could anybody point me in the right direction for some hows to`s on how to
send e-mail from VB?

Basically want a form with 3 x textbox's on 1 for From, 1 for subject, and 1
for message.

My FAQ:

Namespace 'System.Web.Mail' (requires reference to "System.Web.dll"),
FAQ: <URL:http://www.systemwebmail.net/>.

CDO/Exchange:

Support Policy for Microsoft Exchange APIs with .NET Framework Applications
<URL:http://support.microsoft.com/?scid=kb;EN-US;813349>

HOW TO: Retrieve Messages Using CDOEX and ADO in Visual C#
<URL:http://support.microsoft.com/?scid=kb;EN-US;310206>

Self-made:

<URL:http://www.codeproject.com/csharp/karavaev_denis.asp>
<URL:http://www.codeproject.com/csharp/popapp.asp>
<URL:http://www.codeproject.com/csharp/pop3client.asp>

SMTP and POP3 Mail Server
<URL:http://www.codeproject.com/csharp/smtppop3mailserver.asp>

Commercial:

<URL:http://www.abderaware.com/mail/>
 
Hi

this will get you started:

at the top of your project
Imports System.Web.Mail

then the code behind for example a button

try
SmtpMail.SmtpServer = "XXX.XXX.XXX.XXX" IP of an smtp server
Dim Message As MailMessage
Message = New MailMessage()
Message.From = txtFrom.text
Message.To = txtTo.Text
Message.Cc = txtcc.Text
Message.Subject = txtSubject.Text
Message.Body = txtMail.Text
Message.BodyFormat = MailFormat.Text
SmtpMail.Send(Message)
catch ex as exception
msgbox(ex.tostring)
end try

You can also attacht files but for the moment I haven't got time to
give you that code, but looking for that yourself won't hurt you.

HTH
Gr Peter
 
Imports System.Web.Mail
try
SmtpMail.SmtpServer = "XXX.XXX.XXX.XXX" IP of an smtp server
Dim Message As MailMessage
Message = New MailMessage()
Message.From = txtFrom.text
Message.To = txtTo.Text
Message.Cc = txtcc.Text
Message.Subject = txtSubject.Text
Message.Body = txtMail.Text
Message.BodyFormat = MailFormat.Text
SmtpMail.Send(Message)
catch ex as exception
msgbox(ex.tostring)
end try

anyone know how you can do this with authentication ?
 
* (e-mail address removed) (Piedro) scripsit:

It's actually /not/ my FAQ ;-).


I didn't say it was your FAQ, I said it was Herfieds' FAQ lol ;-)
Now I'm going to work

gr Peter
 
Back
Top