PDA

View Full Version : CDOSYS email attachment


Gardy
06-08-2009, 04:26 PM
Hi all,

I have set up several forms on our companies intranet and an eamil routine using CDOSYS but now that I am testing it I have found that it will not work with attachments.

I have verified that the path is correct and that the variable is holding the correct data but I am being told that the specified path cannot be found. I suspect that this is trying to attach to the email from the server, rather than the client machine, so does anybody know how I would be able to correct this?

My code is as follows.

' Email Message Creation
Set myMail=CreateObject("CDO.Message")
myMail.Subject = MsgSubject & " (" & ClientName & ")"
myMail.From = MsgFrom
myMail.To = MsgTo
myMail.HTMLBody = MsgBodyFull
IF str_pic1 <> "" THEN
myMail.AddAttachment str_pic1
END IF
IF str_pic2 <> "" THEN
myMail.AddAttachment str_pic2
END IF
IF str_pic3 <> "" THEN
myMail.AddAttachment str_pic3
END IF
IF str_pic4 <> "" THEN
myMail.AddAttachment str_pic4
END IF
IF str_pic5 <> "" THEN
myMail.AddAttachment str_pic5
END IF
myMail.Send
set myMail=nothing

Any help is greatly appriciated.
Thanks.

Old Pedant
06-08-2009, 07:35 PM
Yes, of course. You can ONLY attach files that are on the server.

There is no possible way for the server to reach out and grab files from a client machine.

If it could, that would be a HUGE breach in security! Imagine CDO attaching your password files or your banking statements and sending them to the world.