p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

proasp_codeclinic thread: loop , send mail, schedule task


Message #1 by dont worry <aspmailbox@y...> on Mon, 26 Feb 2001 09:24:45 -0800 (PST)
Also,
Aspemail gives me a 'Mail.Host' option which I can
assign up to 3 servers to send the mail.  How does CDO
know where to send the email to if it is not assigned
in the code?

Thank you,
dw

--- Draco Associates Ltd <jmail@d...>
wrote:
> DW, I had trouble doing this too, also using the
> ASPMail component.
> In my case, I got a timeout message.
> 
> The solution recommended by a few people was to use
> NT's native CDO
> instead.  Ten minutes of code adjustments, and
> voila!
> 
> Set objMailer 
> Server.CreateObject("CDONTS.NewMail")
> With objMailer
> .From = strYourEmailAddress
> .To = strRecipientEmailAddress
> .Subject = strSubject
> If (you want HTML mail) Then
> .BodyFormat = 0 ' CdoBodyFormatHTML
> .MailFormat = 0 ' CdoMailFormatMime
> .Body = strBodyText
> Else ' want plain text mail
> .BodyFormat = 1 ' CdoBodyFormatText
> .MailFormat = 1 ' CdoMailFormatText
> .Body = strBodyText
> End If
> .Send
> End With
> Set objMailer = Nothing
> 
> IMPORTANT NOTES
> 
> 1. You *do* have to create and destroy the object
> for each message.
> Despite that, it's faster than ASPMail and (for me)
> it works.
> 
> 2. strBodyText must include all your HTML code if
> you're sending HTML
> mail.  If memory serves, ASPMail will insert a
> couple of basic HTML
> tags for you, but CDO won't.
> 
> Hope this helps.


  Return to Index