Sending e-mails in ASP

by 10 replies
12
I got this script from one ASP tutorial (click here to see it):













on a free asp-supported remote
server. Then I tried to open the link to this file in my web browser () -
nothing happened (only got an HTTP 500 page) - and when I checked
my mailbox, I didn't find any new e-mail there. What did I do wrong or
what did I not do?
#programming #asp #emails #sending
  • Banned
    it better to find in codeproject.com its really helpful
    • [1] reply
  • Banned
    Try this code:

    <%@ LANGUAGE="VBSCRIPT" %>
    <HTML>
    <HEAD>
    <TITLE>ASP Email - Send a Simple Plain-Text Email</TITLE>
    </HEAD>
    <BODY>

    <%
    ' Create a mailman
    set mailman = Server.CreateObject("Chilkat.MailMan2")

    ' Any unlock code begins the 30-day trial.
    mailman.UnlockComponent "unlock_code"

    ' Tell the mailman where the SMTP server is located
    mailman.SmtpHost = "smtp.mymailserver.com"

    ' Some SMTP servers require a login/password
    'mailman.SmtpUsername = "myLogin"
    'mailman.SmtpPassword = "myPassword"

    ' Create an Email message
    set email = Server.CreateObject("Chilkat.Email2")

    ' Enter the recipient's information
    email.AddTo "John Smith", "support@chilkatsoft.com"

    ' Enter the sender's information
    email.FromName = "Joe Smith"
    email.FromAddress = "joe.smith@somedomain.com"

    ' Enter the email subject
    email.Subject = "Simple plain-text email"

    email.Body = "This is a test"

    ' Sends the email with the patterns replaced.
    if mailman.SendEmail(email) then
    Response.write "Message sent successfully!<br><br>"
    else
    Response.write mailman.LastErrorHtml
    end if

    Set email = Nothing
    Set mailman = Nothing

    %>

    </BODY>
    </HTML>
    • [1] reply
    • Hello, Jenniferlinn!

      I tried your code on two different free asp-supporting
      hosts and in both cases I was getting the same error
      message:



      Line 10 is this line in your code:



      It looks like the object cannot be created here. Why
      is it so?
  • Because you don't have Chilkat on your server so it can't create something out of something that doesn't exist.
    • [1] reply
    • I see, thank you. Is there any way for me to get this "Chilkat" and place it on my server (which is a free one). Will a free server allow me to do that?
  • You have to ask your host if they are willing to install that component. Most are reluctant to install components.
    • [1] reply
  • Go into internet options, advanced and disable "friendly http errors"
    then you will get an actual error message from the server instead of the IE error message.
    • [1] reply

Next Topics on Trending Feed