Click to See Complete Forum and Search --> : Using Message.CDO to attach a document


suddethm
07-12-2006, 12:45 PM
Does anyone know where I can find some sample code that allows a form to send a file to an email via Message.CDO?

Michelle

suddethm
07-12-2006, 12:48 PM
The the code I have so far is:

'Retrieve Variables from Form
txtFName=Request.Form("txtFName")
Email=Request.Form("txtEmail")
uploadResume=Request.Form("uploadResume")




If Email = "" then Email = "someone@somewhere.com"

strBodyText = "Title" & vbcrlf & vbcrlf
strBodyText = strBodyText & "First Name: " & Chr(9) & txtFName & vbcrlf


set objNewMail = Server.CreateObject("CDO.Message")
objNewMail.To = "email@cox.net"
objNewMail.From = Email
objNewMail.Subject = "Title"
objNewMail.TextBody = strBodyText
objNewMail.AddAttachment("uploadResume")
objNewMail.Send
set objNewMail = nothing

Terrorke
07-13-2006, 01:16 AM
Here are some links :

http://www.w3schools.com/asp/asp_send_email.asp
http://www.paulsadowski.com/WSH/cdo.htm
http://www.freevbcode.com/ShowCode.Asp?ID=7504

Hope these are usefull