Solved CDO Email: 530 Authentication Required (1 Viewer)

ions

Access User
Local time
Today, 04:30
Joined
May 23, 2004
Messages
785
Hello MS Access Expert,

I am receiving the below 530 Authentication Required error despite having Authentication turned on in my VBA code (See below). The email provider I am using is 1and1 with the below posted settings. When I turn on .Item(sch & "sendtls") = True I still receive the same 530 Error message. When I set .Item(sch & "smtpusessl") = True I receive a the "transport failed to connect to server error."

I called 1and1 but they don't provide support for these type of issues and I am not sure how to further proceed.

Thank you for any assistance you can provide.


1710544256007.png


With cdoConfig.Fields
.Item(sch & "sendusing") = 2
.Item(sch & "smtpserverport") = 587
.Item(sch & "smtpserver") = "smtp.1and1.com"
.Item(sch & "smtpauthenticate") = 1
.Item(sch & "sendusername") = "your-email@1and1.com"
.Item(sch & "sendpassword") = "Your 1and1.com password"
.Item(sch & "sendemailaddress") = "your-email@1and1.com"
.Update
End With


1710544088446.png


1710544953475.png


Full Code:

Code:
Public Sub Send1and1()

    Dim objMessage As Variant
    Dim cdoConfig As Variant
    Dim sch As String

    'Set up cdo Configurations
    sch = "http://schemas.microsoft.com/cdo/configuration/"

    Set cdoConfig = CreateObject("CDO.Configuration")

    With cdoConfig.Fields
       .Item(sch & "sendusing") = 2
       .Item(sch & "smtpserverport") = 587
       .Item(sch & "smtpserver") = "smtp.1and1.com"
       .Item(sch & "smtpauthenticate") = 1
       .Item(sch & "sendusername") = "your-email@1and1.com"
       .Item(sch & "sendpassword") = "Your 1and1.com password"
       .Item(sch & "sendemailaddress") = "your-email@1and1.com"
       .Item(sch & "sendtls") = True
       .Item(sch & "smtpusessl") = True
       .Update
    End With


    'Creates CDO mail object

    Set objMessage = CreateObject("CDO.Message")
    Set objMessage.Configuration = cdoConfig

    objMessage.Subject = "Peter CDO"

    objMessage.From = "your-email@1and1.com"
  
    objMessage.To = "destination@access.ca"
  
    objMessage.TextBody = "CDO Test"
    objMessage.Send

    Set objMessage = Nothing
    Set cdoConfig = Nothing

End Sub
 

Attachments

  • 1710544161954.png
    1710544161954.png
    9.7 KB · Views: 17

isladogs

MVP / VIP
Local time
Today, 12:30
Joined
Jan 14, 2017
Messages
18,225
See my article & example app:

This explains the reasons for all CDO errors including both of those shown above
 

ions

Access User
Local time
Today, 04:30
Joined
May 23, 2004
Messages
785
Thank you for your response isladogs. I was not able to resolve the issue using the suggestions in the Help file. (See below screenshots) Any additional assistance is appreciated.

I entered all the parameters into your CDO program. For the 530 Authentication Required error, I actually receive it when SMPT Authenticate is already set to 1.

1710612492414.png


When I turn on SSL transport I get the error failed to connect to server.

1710612626709.png
 

isladogs

MVP / VIP
Local time
Today, 12:30
Joined
Jan 14, 2017
Messages
18,225
My help file covers all the reasons I've ever met for the various CDO errors.
The transport failed to connect to the server error is the most tricky to fix as it has 4 possible causes:
- server address / port / password / SSL setting wrong.

The likelihood is that it doesn't like port 587 for CDO in your case as it wants to use STARTTLS but that is blocked for that port
See the second linked article by Philipp Stiefel for a detailed explanation

Try port 25 which does allow STARTTLS instead. Does that work?
 

ions

Access User
Local time
Today, 04:30
Joined
May 23, 2004
Messages
785
Hi isladogs,

Changing the port to 465 allowed the email to be sent. Thank you very much isladogs!

1710674045535.png
 

isladogs

MVP / VIP
Local time
Today, 12:30
Joined
Jan 14, 2017
Messages
18,225
That’s great. I thought it would work with port 25 but hadn’t considered trying 465.
 

isladogs

MVP / VIP
Local time
Today, 12:30
Joined
Jan 14, 2017
Messages
18,225
That link doesn't really help here. The issue is (I believe) STARTTLS which is not available using CDO in port 587
 

Users who are viewing this thread

Top Bottom