09-16-05 11:00 PM
The syntax can be tricky when you do that. For now, how about substituting
the variable with the actual path name? Then, just to see the variable at
run time, try the following code (note the fix to the Mailer.From because
you would have the subject as the sender in your post Because you set
the attachment type, it's not necessary to set the Mailer.MailFormat
information. It'll default.
Set Mailer = CreateObject("CDONTS.NewMail")
Call Mailer.AttachFile("\\server\schedule\sched.xls", "SCHED.XLS",1)
Mailer.Send "Automated Schedule Generator", "user1@example.com", _
"Schedule", "Here's the new schedule", 0
Set Mailer = Nothing
This example comes from
http://msdn.microsoft.com/library/d...e0396f0d7d1.asp
if you're interested.
Do you get the same results? Any particular reason you're writing this to a
2000 or older OS?
Al
"lankylad" <lankylad@discussions.microsoft.com> wrote in message
news:FC042128-105C-4DBF-A825-0EEA38A9154B@microsoft.com...[vbcol=seagreen]
>I have changed the code to the following, but get the same error. The
> zipfilename is a full path to the file
>
> Dim Mailer
> Set Mailer = CreateObject("CDONTS.Newmail")
> Mailer.MailFormat = 0
> Mailer.AttachFile zippedfilename, "Zipped File", 1
> Mailer.To = EmailAddress
> Mailer.From = Emailsubject
> Mailer.Subject = Emailsubject
> Mailer.Body = ""
> Mailer.Send
> Set Mailer = Nothing
>
> "Al Mulnick" wrote:
>
[ Post a follow-up to this message ]
|