CFF KB - Carrz-Fox-Fire Promotions Knowledge Base

CFF KB is all about 1 thing: The Sharing of Knowledge and the Power we gain from it.
  • Breadrumbs:
  • error '8004020f'

  • CFF Knowledge Base - Share With Facebook CFF Knowledge Base - Share on Twitter CFF Knowledge Base - Share on Reddit CFF Knowledge Base - Share on Digg It CFF Knowledge Base - Share on Stumble Upon It CFF Knowledge Base - Share on Delicious
    Share With Friends (Updated 6-8-2010)
  • Article ID:
    217
  • Date Created
    Monday, December 17, 2018
  • This Article Has been Viewed
    724 times
  • Short Desc
    Trying to send mail with CDOSYS, I get the following error, error '8004020f'
  • Details
    Our variables are created to their associated form fields. So we have to make sure when we reuse the variables that we either "copy and paste" them. Or, if we are working on another page that was the variables are stored at. We need to make sure we properly spell them correctly.
  • Recreate Issue
    To Recreate this issue, perform the following.

    <%
    Set myMail = CreateObject("CDO.Message")

    'This section provides the configuration information for the remote SMTP server.

    myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'Send the message using the network (SMTP over the network).
    myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = 192.168.2.8
    myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
    myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False 'Use SSL for the connection (True or False)
    myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
    myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 'basic (clear-text) authentication
    myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") =sendusername
    myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") =sendpassword


    myMail.Configuration.Fields.Update

    'End remote SMTP server configuration section==

    myMail.To = recieverusername
    myMail.Subject = "this is the subject"
    myMail.From = sendusername
    myMail.TextBody = "this is the body"
    myMail.Send
    Set myMail = Nothing
    %>



    In the above myMail.To, line.
    We have "recieverusername", however, the variable is misspelled (receiver not, reciever). So, it is not finding the email address associated with the variable.
  • Resolve Issue
    to resolve this issue.

    Make sure all your variables are spelled correctly, and that they are associated with the proper form field, in order for the mail to send.
    In the above issue, we see that the word "reciever" is incorrectly spelled, so to the CDOSYS component cannot find an email address to connect to the variable. Correctly spelling the word, will resolve this issue.
    "receiverusername"

    <%
    Set myMail = CreateObject("CDO.Message")

    'This section provides the configuration information for the remote SMTP server.

    myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'Send the message using the network (SMTP over the network).
    myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = 192.168.2.8
    myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
    myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False 'Use SSL for the connection (True or False)
    myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
    myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 'basic (clear-text) authentication
    myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") =sendusername
    myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") =sendpassword


    myMail.Configuration.Fields.Update

    'End remote SMTP server configuration section==

    myMail.To = receiverusername ' variable correctly spelled out properly.
    myMail.Subject = "this is the subject"
    myMail.From = sendusername
    myMail.TextBody = "this is the body"
    myMail.Send
    Set myMail = Nothing
    %>