Actually, CDO uses the local MS SMTP server.  You can't specify another SMTP
server with it.  Also, there's little to no error checking available for
CDO, so I never recommend it for that reason (though you're not doing any
error checking in your code snippet).

Best to use one of the plethora of mailing components that has error
checking: ASPMail, Persits' ASPEmail is fine, or JMail, or whatever you have
on hand.  Some pay-for components also have asynchronous queueing so the
page doesn't have to wait while the email is sent.

.NET has mailing built-in, but still no queuing without a third party
mailing component.

Darin.


----- Original Message ----- 
From: "Corsair" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, December 15, 2004 9:12 AM
Subject: RE: [IMail Forum] Sending HTML email from ASP or VB code


Thank you everyone for your replies.

Laura's original solution of just setting the mime type works for my
situation, but it looks like there's a variety of possibilities out there to
cover different situations.

Thanks, Matt, for pointing out that this was ASPMail on the system. It's a
customer's machine, and I copied code they were using to send text-only form
responses to themselves, so I wasn't aware they had ASPMail loaded.

You learn something new every day. Why ASPMail gave their object such a
cyptic name is beyond me.

Grant, if you find anything with HTML emails from ASPMail that include an
attachment, it sounds like that would add a useful bit of knowledge to the
discussion.

A few people mentioned CDO. Do any of you have the appropriate code snippet
for specifying which host CDO should use for mail sending? I know there's an
equivalent of "Mailer.RemoteHost = smtpMailHost" for CDO, but I think it
requires declaring an instance of a SMTPMail object somewhere. I've not had
to use it before, so I don't really remember what it is.

Thank you all again,

JB

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Grant Griffith -
IMail
Sent: Monday, December 13, 2004 4:01 PM
To: [EMAIL PROTECTED]
Subject: RE: [IMail Forum] Sending HTML email from ASP or VB code

We use ASPMail to send some HTML emails and it works just fine.  I will try
to find a sample to send.


Thanks,
Grant Griffith
EI8HT LEGS, A Division of ETC
(877)483-3393
(812)933-5390
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Matt
Sent: Monday, December 13, 2004 3:53 PM
To: [EMAIL PROTECTED]
Subject: Re: [IMail Forum] Sending HTML email from ASP or VB code

JB,

You are actually using a server-side ActiveX component called ASPMail to
handle the E-mail.  Instructions for this component can be found on the
following page:

    http://www.serverobjects.com/comp/Aspmail4.htm

You control the content-type with the "ContentType" property.  It appears
however that you can only set one content-type per message, and you are
therefore SOL with this component.

If you are on a Windows 2000 machine, look into using the built-in CDO
object for sending E-mail.  You can definitely construct a message with both
content-types.


http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cdosys/html
/_cdosys_imessage_interface.asp

You can also Google for many other coding examples using "CDO ASP".

Matt



Corsair wrote:

>I'm attempting to send an HTML-formatted email from a Visual Basic 6.0
>module or VBScript on an ASP page using the following code, and can
>successfully send text-formatted mail, but if I send it HTML code it
>will send this plain text rather than in HTML format. Can anyone tell
>me how to change the code, or the IMail settings, to send HTML formatted
mail?
>
>The various str items, such as strMailBody, are variables receiving
>appropriate text up above where this is called.
>
>Thank you,
>
>JB
>
>        Dim Mailer As Object
>        Const smtpMailHost = "mydomainname.com"
>        ' call mail object
>        Set Mailer = CreateObject("SMTPsvg.Mailer")
>        Mailer.RemoteHost = smtpMailHost
>
>        ' set up message
>        Mailer.FromAddress = strFromEmail
>        Mailer.fromName = strFromName
>        Mailer.AddRecipient strToName, strToEmail
>        If strCCEmail <> "" Then
>            Mailer.AddCC strCCName, strCCEmail
>        End If
>
>        Mailer.Subject = strSubject
>        Mailer.BodyText = strMailBody
>
>        Mailer.SendMail
>        Set Mailer = Nothing
>
>
>To Unsubscribe: http://www.ipswitch.com/support/mailing-lists.html
>List Archive:
>http://www.mail-archive.com/imail_forum%40list.ipswitch.com/
>Knowledge Base/FAQ: http://www.ipswitch.com/support/IMail/
>
>
>
>

--
=====================================================
MailPure custom filters for Declude JunkMail Pro.
http://www.mailpure.com/software/
=====================================================


To Unsubscribe: http://www.ipswitch.com/support/mailing-lists.html
List Archive: http://www.mail-archive.com/imail_forum%40list.ipswitch.com/
Knowledge Base/FAQ: http://www.ipswitch.com/support/IMail/


To Unsubscribe: http://www.ipswitch.com/support/mailing-lists.html
List Archive: http://www.mail-archive.com/imail_forum%40list.ipswitch.com/
Knowledge Base/FAQ: http://www.ipswitch.com/support/IMail/


To Unsubscribe: http://www.ipswitch.com/support/mailing-lists.html
List Archive: http://www.mail-archive.com/imail_forum%40list.ipswitch.com/
Knowledge Base/FAQ: http://www.ipswitch.com/support/IMail/


To Unsubscribe: http://www.ipswitch.com/support/mailing-lists.html
List Archive: http://www.mail-archive.com/imail_forum%40list.ipswitch.com/
Knowledge Base/FAQ: http://www.ipswitch.com/support/IMail/

Reply via email to