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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Send eMail attachments

Status
Not open for further replies.

SmokeyJoe

Programmer
Nov 13, 2000
80
0
0
US
I have a MYSQL database of members, I want to be able to send members emails with attachments.

Using the following code I can send emails without attachments but get error 800421a when I try an attachment.

I believe the problem is the attachment is on localhost and the server tries to find it on the server.

Data is selected/entered on the previous page and set into variables using "Request.form"

vAttachment contains the address of the file on the local computer; "C:\myfile\xxx.txt".

CODE:
Set oMSG = createobject("CDO.Message")
oMSG.To = veMailAddress
oMSG.From = vSender
oMSG.Subject = vSubject
oMSG.TextBody = veMailMessage
if vAttachment <> "" then
Att = " & vAttachment
oMSG.AddAttachment(Att)
end if
oMSG.Send()
set oMSG=nothing

I have tried several various ideas of " without success. What is the correct way to add an attachment using a file on the local computer?

Thanks for any help
smokeyjoe
 
This issue has also been posted in another forum. In any event, it is not a MySQL issue.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top