CDO- error '8004020f' - SMTP

Results 1 to 2 of 2

Thread: CDO- error '8004020f' - SMTP

  1. #1
    Join Date
    Dec 1969

    Default CDO- error '8004020f' - SMTP

    I&#039;ve used the code below. It sends email as long as email is being sent to any domain on my mail server. But when I change email to send out to domain not on our mail server I gives the error:<BR><BR>error &#039;8004020f&#039; <BR><BR>points to the line ".send".<BR><BR>My SMTP server do require authentication, but I&#039;m passing my smtp account information that is username and password. But still it gives the same error. Any ideas? where to look for?<BR><BR>thanks in advance.<BR>MY CODE:<BR>sch = "" <BR> <BR> Set cdoConfig = CreateObject("CDO.Configuration") <BR> <BR> With cdoConfig.Fields <BR> .Item(sch & "sendusing") = 2 &#039; cdoSendUsingPort <BR> .Item(sch & "smtpserver") = "mysmtpservername"<BR> .Item(sch & "SendUsername") = "myusername"<BR> .Item(sch & "SendPassword") = "mypassword"<BR> .update <BR> End With <BR> <BR> Set cdoMessage = CreateObject("CDO.Message") <BR> <BR> With cdoMessage <BR> Set .Configuration = cdoConfig <BR> .From = "" <BR> .To = "email@domainnotonmyserver" <BR> .Subject = "Sample CDO Message" <BR> .TextBody = "This is a test for CDO.message" <BR> .Send <BR> End With <BR> <BR> Set cdoMessage = Nothing <BR> Set cdoConfig = Nothing<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: CDO- error '8004020f' - SMTP

    check the relaying permissions in IIS SMTP settings.

Posting Permissions

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