sample ASP XP Mail component

L

Lord Merlin

Hi

Can anyone please give me some sample ASP XP Mail code?

My ISP decided to use this now, and their website isn't up yet! I just need
some samples that can send an HTML email, with embedded images


--

Kind Regards
Rudi Ahlers
+27 (82) 926 1689

Greater love has no one than this, that he lay down his life for his friends
(John 15:13).
 
A

Aaron Bertrand [MVP]

Can anyone please give me some sample ASP XP Mail code?

First, can you tell us what "ASP XP Mail" is?
 
S

Scott McNair

First, can you tell us what "ASP XP Mail" is?

I think he's talking about sending mail using ASP thru IIS on an XP box.
Merlin, correct me if I'm wrong. If I am, then just put the following
in the "general knowledge" category:

You would use CDONTS.NewMail for this. If you're running on XP
Pro/Home, the required DLL (CDONTS.DLL) is missing, and you will have to
locate it on a 2K box (or on the web), stick it in your system32 folder,
and do a "regsvr32 cdonts.dll" from the command-line.

Beyond that, it's pretty straightforward:

Set MyMail = Server.CreateObject("CDONTS.NewMail")
With MyMail
.To = "(e-mail address removed)"
.From = "(e-mail address removed)"
.Subject = "Hello World"
.Body = "This is the body of the message."
.Send
End With

There are tons of of other CDONTS.NewMail properties; for more details,
I suggest a Google web-search.
 
L

Lord Merlin

No, it's called ASPXP Mail Component, from a company called Moonshake. This
is the link I was given,
http://www.aspxp.com/Documentation/ASPXPMail/AtAGlance.asp

And yes, from this I could imagine the server is a M$ XP server, but
unfortunatelly the tech support isn't very helpful, they always think
because you're a developer, you know everything....... Asif I had 3 / 7
machines @ home with every different configuration possible. Currently I am
using CDONTS, but they want me to make use of a remote server. So they told
me to make use of ASPXP Mail:


Hi Rudi,

ASPMail does not cater for embedded images.

For you to send embedded images you need to use the ASPXPmail component.

Regards,
Laurent

--

Kind Regards
Rudi Ahlers
+27 (82) 926 1689

Greater love has no one than this, that he lay down his life for his friends
(John 15:13).
: :
: >> Can anyone please give me some sample ASP XP Mail code?
: >
: > First, can you tell us what "ASP XP Mail" is?
:
: I think he's talking about sending mail using ASP thru IIS on an XP box.
: Merlin, correct me if I'm wrong. If I am, then just put the following
: in the "general knowledge" category:
:
: You would use CDONTS.NewMail for this. If you're running on XP
: Pro/Home, the required DLL (CDONTS.DLL) is missing, and you will have to
: locate it on a 2K box (or on the web), stick it in your system32 folder,
: and do a "regsvr32 cdonts.dll" from the command-line.
:
: Beyond that, it's pretty straightforward:
:
: Set MyMail = Server.CreateObject("CDONTS.NewMail")
: With MyMail
: .To = "(e-mail address removed)"
: .From = "(e-mail address removed)"
: .Subject = "Hello World"
: .Body = "This is the body of the message."
: .Send
: End With
:
: There are tons of of other CDONTS.NewMail properties; for more details,
: I suggest a Google web-search.
 
L

Lord Merlin

Can CDO send SMTP mail, i.e. My website is on serverA, and mail needs to be
send via serverB?

And can it embed images in HTML?

If so, would you mind showing me how?

--

Kind Regards
Rudi Ahlers
+27 (82) 926 1689

Greater love has no one than this, that he lay down his life for his friends
(John 15:13).
"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
: EEK. If cdonts isn't there then use CDO.... only under deperate times
should
: you revert back to cdonts instead of cdo. cdo is native to 2000, xp and
2003
:
:
: --
: Curt Christianson
: Owner/Lead Developer, DF-Software
: www.Darkfalz.com
:
:
: : > : >
: > >> Can anyone please give me some sample ASP XP Mail code?
: > >
: > > First, can you tell us what "ASP XP Mail" is?
: >
: > I think he's talking about sending mail using ASP thru IIS on an XP box.
: > Merlin, correct me if I'm wrong. If I am, then just put the following
: > in the "general knowledge" category:
: >
: > You would use CDONTS.NewMail for this. If you're running on XP
: > Pro/Home, the required DLL (CDONTS.DLL) is missing, and you will have to
: > locate it on a 2K box (or on the web), stick it in your system32 folder,
: > and do a "regsvr32 cdonts.dll" from the command-line.
: >
: > Beyond that, it's pretty straightforward:
: >
: > Set MyMail = Server.CreateObject("CDONTS.NewMail")
: > With MyMail
: > .To = "(e-mail address removed)"
: > .From = "(e-mail address removed)"
: > .Subject = "Hello World"
: > .Body = "This is the body of the message."
: > .Send
: > End With
: >
: > There are tons of of other CDONTS.NewMail properties; for more details,
: > I suggest a Google web-search.
:
:
 
A

Aaron Bertrand [MVP]

Yes, CDO can send mail via a remote SMTP server.
http://www.aspfaq.com/2026

You can send in HTML format, though I strongly recommend sending a plain
text version as well (since many people, myself included, set their e-mail
client to show plain text only).
http://www.aspfaq.com/2474

As for embedding images, one way to accomplish that is having an absolute
link to an online resource, e.g.

<img src="http://yourserver/yourimage.gif">

The other would be to create an HTML page that looks exactly how you want
the e-mail to look, then do this:

<%
CONST SMTPServer = "your.mail.server"
CONST cdoURL = "http://schemas.microsoft.com/cdo/configuration/"

FromAddress = "(e-mail address removed)"
FromName = "Your Name"
ToAddress = "(e-mail address removed)"
ToName = "Their Name"
Subject = "The subject of the message"
ThePageYouWantToMimic = "http://www.microsoft.com/"

set cdoM = CreateObject("CDO.Message")
set cdoC = CreateObject("CDO.Configuration")

Set cdoF = cdoC.Fields
With cdoF
.Item(cdoURL & "sendusing") = 2
.Item(cdoURL & "smtpserver") = SMTPServer
.Item(cdoURL & "smtpconnectiontimeout") = 10
.Update
End With

With cdoM
Set .Configuration = cdoC
.CreateMHTMLBody ThePageYouWantToMimic
.From = FromAddress
.To = ToAddress
.Subject = Subject
.Send
End With

Set cdoM = Nothing
Set cdoS = Nothing
Set cdoF = Nothing
%>

I'm not sure how that would appear in non-Microsoft e-mail clients (note
that many will STILL see plain text and images as attachments), and I'm not
going to download and install one to check. I think it's pretty invasive
for you to force users to store your HTML on their machine, but I've been
down this road before. And generally, it is frowned upon in a Microsoft
group to use a berating acronym like M$.
 
L

Lord Merlin

: Yes, CDO can send mail via a remote SMTP server.
: http://www.aspfaq.com/2026
:
: You can send in HTML format, though I strongly recommend sending a plain
: text version as well (since many people, myself included, set their e-mail
: client to show plain text only).
: http://www.aspfaq.com/2474
:
: As for embedding images, one way to accomplish that is having an absolute
: link to an online resource, e.g.
:
: <img src="http://yourserver/yourimage.gif">
:
: The other would be to create an HTML page that looks exactly how you want
: the e-mail to look, then do this:
:
: <%
: CONST SMTPServer = "your.mail.server"
: CONST cdoURL = "http://schemas.microsoft.com/cdo/configuration/"
:
: FromAddress = "(e-mail address removed)"
: FromName = "Your Name"
: ToAddress = "(e-mail address removed)"
: ToName = "Their Name"
: Subject = "The subject of the message"
: ThePageYouWantToMimic = "http://www.microsoft.com/"
:
: set cdoM = CreateObject("CDO.Message")
: set cdoC = CreateObject("CDO.Configuration")
:
: Set cdoF = cdoC.Fields
: With cdoF
: .Item(cdoURL & "sendusing") = 2
: .Item(cdoURL & "smtpserver") = SMTPServer
: .Item(cdoURL & "smtpconnectiontimeout") = 10
: .Update
: End With
:
: With cdoM
: Set .Configuration = cdoC
: .CreateMHTMLBody ThePageYouWantToMimic
: .From = FromAddress
: .To = ToAddress
: .Subject = Subject
: .Send
: End With
:
: Set cdoM = Nothing
: Set cdoS = Nothing
: Set cdoF = Nothing
: %>
:
: I'm not sure how that would appear in non-Microsoft e-mail clients (note
: that many will STILL see plain text and images as attachments), and I'm
not
: going to download and install one to check. I think it's pretty invasive
: for you to force users to store your HTML on their machine, but I've been
: down this road before. And generally, it is frowned upon in a Microsoft
: group to use a berating acronym like M$.
:
: --
: Aaron Bertrand
: SQL Server MVP


I know what you are saying is true, but the client has requested, and insist
that he keeps his branding, and needs his images embedded in order to keep
his buttons / borders / logos etc in the mail, the same way the website
looks! Even though he gets an odd 60 or so bounces because of companies not
accepting such emails.

I just got a question, which I couldn't seem to figure out. How do I embed
an image with your example? the problem I sit with, is that a lot of users
download email, and disconnect from the internet, thus an absolute link
(www.mysite/images/logo.gif) won't work, as these images will only be
downloaded once the email has been opened, and it tries to connect to the
server.

with CDONTS, I can do this very well:



bodytext = bodytext & "<td align=center><a href='" & domain &
"/kickmeto.asp?page=questionaire_respond.asp&emailrespond=yes&userid=" &
userid & "&questionaireid=2&companyid=" & companyid & "&response=5"
bodytext = bodytext & "&commentid=" & commentid &
"&subcomment=yes&subcommentid=" & subcommentid & "'>"
bodytext = bodytext & "<img src=""face_m2.gif"" width='24' height='23'
border=0></a></td>"
End If
bodytext = bodytext & "</tr>"
bodytext = bodytext & "<tr align=center bgcolor='#FFFFFF' ><td
width='20%'><font size=2>Over The Moon</td><td width='20%'><font
size=2>Quite Impressed</td><td width='20%'><font size=2>Indifferent</td><td
width='20%'><font size=2>Not Impressed</td><td width='20%'><font
size=2>Utterly Disgusted</td></tr>"

on error resume next
Set Mailer = Server.CreateObject("CDONTS.NewMail")
mailer.AttachURL file_path + "face_0.gif", "face_0.gif"
mailer.AttachURL file_path + "face_1.gif", "face_1.gif"
mailer.AttachURL file_path + "face_2.gif", "face_2.gif"
mailer.AttachURL file_path + "face_m1.gif", "face_m1.gif"
mailer.AttachURL file_path + "face_m2.gif", "face_m2.gif"

Mailer.From = strFrom
Mailer.Importance = 2
Mailer.BodyFormat = 0
Mailer.MailFormat = 0
Mailer.To = email
Mailer.Body = bodytext

Mailer.Send




--

Kind Regards
Rudi Ahlers
+27 (82) 926 1689

Greater love has no one than this, that he lay down his life for his friends
(John 15:13).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top