Sending Email with CDO via asp script

Discussion in 'Classic ASP' started by joneilthe2, Jul 2, 2008.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. I have this script below that emails info to a customer. It works great for almost every recipient, but the one person I want it to go to says they never receive the email. I assume their server is blocking it because it thinks it is spam...? does anyone else have a problem sending mail with CDO?
    If so, is there an alternitive?

    thanks,
    John



    set objMessage = createobject("cdo.message")
    set objConfig = createobject("cdo.configuration")

    Set Flds = objConfig.Fields
    Flds.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
    Flds.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost"
    Flds.update

    Set objMessage.Configuration = objConfig

    objMessage.To = someone@theredomain.com"
    objMessage.From = "SummitAssetMgmtCorp.com"
    objMessage.Subject = "Information Request"

    objMessage.TextBody = "Text"
    objMessage.fields.update
    objMessage.Send

    set objMessage = nothing
    set objConfig = nothing
     
  2. If their mail server is considering it as spam, then I don't think it's a problem with CDO. Can they receive other emails with different subject or body content? Also the FROM address does not look like a valid email address.

    Aristotle

    DiscountASP.NET
    www.DiscountASP.NET
     
  3. Thank you forthe post. You are correct. I noticed this a bit after posting. TheFROM email address wasn't an email address, just a domain name and that was causing the problem.
     
  4. The following is my code. Am I doing something wrong? No matter what 'To' address I use, no email is received.

    *******************************************************
    <%@ Language=VBScript %>
    <%
    set objMessage = createobject('cdo.message')
    set objConfig = createobject('cdo.configuration')

    Set Flds = objConfig.Fields
    Flds.Item('http://schemas.microsoft.com/cdo/configuration/sendusing') = 2
    Flds.Item('http://schemas.microsoft.com/cdo/configuration/smtpserver') = 'localhost'
    Flds.update

    Set objMessage.Configuration = objConfig

    objMessage.To = '[email protected]'
    objMessage.From = '[email protected]'
    objMessage.Subject = 'Information Request'

    objMessage.TextBody = 'Text'
    objMessage.fields.update
    objMessage.Send

    set objMessage = nothing
    set objConfig = nothing

    %>
    *******************************************

    Any ideas?
    Kris
     
  5. Bruce

    Bruce DiscountASP.NET Staff

    if you are not getting any error, the email is sent.


    Could the email be trapped by a spam filter?


    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page