Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sending SMTP E-mail with attachments

Status
Not open for further replies.

EnemyGateIsDown

Technical User
Oct 3, 2002
235
GB
Hi Guys,

I want to send an SMTP email and include an attachment from my VB.NET application. When using ASP I was able to do this using a third party library as follows:

Code:
			Set Mail = Server.CreateObject("Persits.MailSender")

			   Mail.Host = Session("Mailhost")
			   Mail.From = Session("FromAddress") ' From address
			   Mail.FromName = "Meeting Room Manager"
			   Mail.AddAddress emailTo, emailTo

			   emailSubject = sSubject
			   Mail.Subject = emailSubject

			   emailMessage = session("LotusNotesBodyMessage")

			   Mail.Body = emailMessage

			   If addressBookID <=0 or templateID = 4 then
					Mail.AddAttachment session("AppDir") & "\" & ICS_ID &".ics"
			   End If

				'Need to look up

			   Mail.SendToQueue(Application("sMailQueue"))
			   Mail.Reset

How can I achieve the same thing in VB.NET?
 
if you use .net 2.0 then you will find it in system.Net.Mail

otherwise look in

system.web.mail


Christiaan Baes
Belgium

"My new site" - Me
 
My laptop (Windows XP client) does not currently include CDO.sys which I think is the reason I cant use system.web.mail..

Does anyone know where I can get it from?

Any help is as always greatly appreciated.

Cheers,

Chris
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top