Results 1 to 8 of 8
  1. #1
    MattBristow is offline new member
    Join Date
    May 2009
    Posts
    6

    Default mailsend from classic asp

    I'm using classic asp what method is allowed to invoke an email to be sent from a form?

  2. #2
    eUK-Martin's Avatar
    eUK-Martin is offline Windows System Administrator
    Join Date
    Nov 2005
    Location
    Earth
    Posts
    629

    Default

    You can use the "CreatObject" method in your ASP scripts and use any of the following component:

    CDOSys
    ASPMAIL
    ASPEMAIL

    If you are also looking for a script then please email windows[at]eukhost.com and we will give you an example script.

  3. #3
    flesso's Avatar
    flesso is offline Voluntary Moderator
    Join Date
    Mar 2007
    Location
    127.0.0.1
    Posts
    1,661

    Default

    I'd give Jmail a try if possible, probably the best one I've ever used. Let me know if you want any code examples.
    Josh

    Resident Blogger

  4. #4
    MattBristow is offline new member
    Join Date
    May 2009
    Posts
    6

    Default

    Hi guys following on from this I have a new problem I need to get round.

    I have the follwoing code which works AOK:

    'Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
    'Mailer.ContentType = "text/html"
    'Mailer.FromName = "XXX"
    'Mailer.FromAddress= "xx@xx.co.uk"
    'Mailer.RemoteHost = "mail.xx.co.uk"
    'Mailer.AddRecipient SendRS("Name"), SendRS("EmailAddress")
    'Mailer.Subject = "XXX"
    'Mailer.BodyText = Mailbody

    I have placed this in a loop where Name and EmailAddress are stored in a db however it doesn't like the referance to a recordset as the recipient, it works if I hardcode the recipient details.

    On another server I use I can get it to work using CDO no problem:

    Set myMail=CreateObject("CDO.Message")
    myMail.Subject= "xxxx"
    myMail.From="xx@xx.co.uk"
    myMail.To= SendRS("EmailAddress")
    myMail.HTMLBody = Mailbody
    myMail.Send
    set myMail=nothing

    Any pointers greatfully recieved

  5. #5
    compserv is offline Senior Member
    Join Date
    Aug 2008
    Posts
    180

    Default

    I've not seen this problem, but have you tried saving the recordset data in a couple of variables:

    txtSendToName = SendRS("Name")
    txtSendToAddress = SendRS("EmailAddress")

    and then:

    Mailer.AddRecipient txtSendToName, txtSendToAddress

    Just a suggestion.

  6. #6
    MattBristow is offline new member
    Join Date
    May 2009
    Posts
    6

    Default

    Yes sorry should have said I have already tried banging them into a couple of vars

  7. #7
    MattBristow is offline new member
    Join Date
    May 2009
    Posts
    6

    Default

    Any other ideas?... anyone

  8. #8
    Rock's Avatar
    Rock is offline Technical Support (eUKhost.com)
    Join Date
    Oct 2006
    Location
    localhost
    Posts
    3,375

    Smile

    Here's a sample working CDOSYS mail script which you can give a try with:
    <%
    Set oMail = Server.CreateObject("CDO.Message")
    Set iConf = Server.CreateObject("CDO.Configuration")
    Set Flds = iConf.Fields
    iConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
    iConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost"
    iConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10
    iConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
    iConf.Fields.Update
    Set oMail.Configuration = iConf
    oMail.To = "recipient@his-domain.co.uk"
    oMail.From = "sender@domain.co.uk"
    oMail.Subject = "Test mail.."
    oMail.BodyPart.ContentTransferEncoding = "quoted-printable"
    oMail.HTMLBody = HTML
    oMail.Send
    Set iConf = Nothing
    Set Flds = Nothing
    %>
    <html>
    Message Sent !!!
    </html>
    Let us know if you need any further assistance.. Good luck !

    Rock _a.k.a._ Jack
    Windows Hosting || Windows Reseller Hosting
    Cloud Hosting 100% UPTIME! || Powerful Dedicated Servers
    Follow eUKhost on Twitter || Join eUKhost Community on Facebook

    For complaints, grievances or suggestions kindly email our FeedBack Dept.
    Proper action will be taken accordingly & instantaneously!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •