sample ASP XP Mail component

Discussion in 'ASP General' started by Lord Merlin, Apr 13, 2004.

  1. Lord Merlin

    Lord Merlin Guest

    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).
     
    Lord Merlin, Apr 13, 2004
    #1
    1. Advertising

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

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

    --
    Aaron Bertrand
    SQL Server MVP
    http://www.aspfaq.com/
     
    Aaron Bertrand [MVP], Apr 13, 2004
    #2
    1. Advertising

  3. Lord Merlin

    Scott McNair Guest

    "Aaron Bertrand [MVP]" <> wrote in
    news:O#L#:

    >> 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 = ""
    .From = ""
    .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.
     
    Scott McNair, Apr 13, 2004
    #3
  4. Lord Merlin

    Lord Merlin Guest

    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).
    "Scott McNair" <> wrote in message
    news:Xns94CA8B1186931sfmco@207.46.248.16...
    : "Aaron Bertrand [MVP]" <> wrote in
    : news:O#L#:
    :
    : >> 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 = ""
    : .From = ""
    : .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.
     
    Lord Merlin, Apr 13, 2004
    #4
  5. Lord Merlin

    Lord Merlin Guest

    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
    news:...
    : 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
    :
    :
    : "Scott McNair" <> wrote in message
    : news:Xns94CA8B1186931sfmco@207.46.248.16...
    : > "Aaron Bertrand [MVP]" <> wrote in
    : > news:O#L#:
    : >
    : > >> 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 = ""
    : > .From = ""
    : > .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.
    :
    :
     
    Lord Merlin, Apr 13, 2004
    #5
  6. Lord Merlin

    Dave Karmens Guest

    http://support.microsoft.com/default.aspx?scid=kb;EN-US;286431


    Lord Merlin wrote:

    > 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
    > news:...
    > : 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
    > :
    > :
    > : "Scott McNair" <> wrote in message
    > : news:Xns94CA8B1186931sfmco@207.46.248.16...
    > : > "Aaron Bertrand [MVP]" <> wrote in
    > : > news:O#L#:
    > : >
    > : > >> 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 = ""
    > : > .From = ""
    > : > .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.
    > :
    > :
    >
    >
     
    Dave Karmens, Apr 13, 2004
    #6
  7. 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 = ""
    FromName = "Your Name"
    ToAddress = ""
    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
    http://www.aspfaq.com/


    "Lord Merlin" <SP4M_Rudi@SP4M_Bonzai.org.za_SP4M> wrote in message
    news:...
    > 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?
     
    Aaron Bertrand [MVP], Apr 13, 2004
    #7
  8. Lord Merlin

    Lord Merlin Guest

    "Aaron Bertrand [MVP]" <> wrote in message
    news:...
    : 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 = ""
    : FromName = "Your Name"
    : ToAddress = ""
    : 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).
     
    Lord Merlin, Apr 17, 2004
    #8
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John Dalberg
    Replies:
    1
    Views:
    2,637
    =?Utf-8?B?U2l2YSBN?=
    Sep 19, 2005
  2. Jake
    Replies:
    0
    Views:
    566
  3. Michel

    asp mail without using a mail component

    Michel, Jul 14, 2004, in forum: ASP General
    Replies:
    4
    Views:
    135
    Ray at
    Jul 15, 2004
  4. Tim Chase
    Replies:
    0
    Views:
    79
    Tim Chase
    Feb 16, 2014
  5. Terry Reedy
    Replies:
    0
    Views:
    85
    Terry Reedy
    Feb 16, 2014
Loading...

Share This Page