ChainsawJoe
Programmer
G'morning all.
This one is really confusing me; I'm using CDONTS NewMail to send an email having attached a file using the .AttachFile method. If I
[ol]
[li]Attach no file - the email recieved is fine and dandy[/li]
[li]Attach two files - the email is great. With both attachments as should be.[/li]
[li]Attach one file - the .Body is attached and the .AttachFile becomes the .Body[/li][/ol]
Does that make sense? If I attach one file, the resulting email has the specified body as the attachment and the attachment is shown as the email body! To make it "work" I could either comment out the .AttachFile or copy and paste it again below - these work fine.
Has anyone else had this problem? Could it be a dodgy CDONTS that I should get my host to reinstall?
Here's a section of the function I use;
arigato gozaimasu, everybody.
Joe --------------------------------------------------
- better than toast.
Penguins - better than --------------------------------------------------
This one is really confusing me; I'm using CDONTS NewMail to send an email having attached a file using the .AttachFile method. If I
[ol]
[li]Attach no file - the email recieved is fine and dandy[/li]
[li]Attach two files - the email is great. With both attachments as should be.[/li]
[li]Attach one file - the .Body is attached and the .AttachFile becomes the .Body[/li][/ol]
Does that make sense? If I attach one file, the resulting email has the specified body as the attachment and the attachment is shown as the email body! To make it "work" I could either comment out the .AttachFile or copy and paste it again below - these work fine.
Has anyone else had this problem? Could it be a dodgy CDONTS that I should get my host to reinstall?
Here's a section of the function I use;
Code:
sub subSendEmail(sEmailTemplateFile, sAttachFileName, iUserID)
'-- declare vars
dim oMail, sEmailBody
Set oMail = CreateObject("CDONTS.NewMail")
'-- get email body
sEmailBody = fnReadFile(sEmailTemplateFile)
'-- do email stuff
with oMail
'-- build headers
.From = "me@here.com"
.To = "you@there.com"
.Bcc = "me2@here.com"
.Subject = "This is a Test"
.Body = sEmailBody
'-- attach index.htm
.AttachFile (Server.MapPath(sAttachFileName),"index.htm")
'-- send the email
.Send
end with
'-- stoppit and tidyup
set oMail = nothing
end sub
arigato gozaimasu, everybody.
Joe --------------------------------------------------
- better than toast.
Penguins - better than --------------------------------------------------