Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
TurgayK  
#1 Posted : Thursday, March 24, 2022 8:28:54 AM(UTC)
TurgayK

Rank: Newbie

Groups: Registered
Joined: 3/24/2022(UTC)
Posts: 1

Hello,

I am trying to send an email through EASendMail but receive 501 5.5.4 Invalid Address error.
here is my code.
Dim mailAdresses As String = "mymail@company.com"
Dim recipients As AddressCollection = New AddressCollection()
recipients.AddRange(New AddressCollection(mailAdresses))

Dim address As EASendMail.MailAddress = TryCast(recipients(0), EASendMail.MailAddress)
mail.[To].Add(address)

I try also this.
Dim mailAdresses As String = "mymail@company.com"
mail.To = New AddressCollection(mailAdresses)

Nothing helps.
Anyone has any idea?

Thanks.
ivan  
#2 Posted : Thursday, March 24, 2022 10:17:49 PM(UTC)
ivan

Rank: Administration

Groups: Administrators
Joined: 11/11/2010(UTC)
Posts: 1,154

Thanks: 9 times
Was thanked: 55 time(s) in 55 post(s)
did you set your sender address, you can generate a log file with LogFileName property to get more detail, please don't paste your log content here for security.

https://www.emailarchite...-returned-by-smtp-server
TurgayK  
#3 Posted : Friday, March 25, 2022 12:01:31 AM(UTC)
TurgayK

Rank: Newbie

Groups: Registered
Joined: 3/24/2022(UTC)
Posts: 1

I found out what caused the problem and it was the server.
Here is my code.

Dim mailServer As String = "X.X.X.X" '(IP Address)
Dim smtp As SmtpClient = New SmtpClient()
Dim server As SmtpServer = New SmtpServer(mailServer, 25)

server.UseDefaultCredentials = True
server.ConnectType = SmtpConnectType.ConnectTryTLS
smtp.Connect(server)

and if i delete ConnectType section the error turns to "The requested name is valid, but no data of the requested type was found"

Really annoying.
TurgayK  
#4 Posted : Friday, March 25, 2022 12:41:47 AM(UTC)
TurgayK

Rank: Newbie

Groups: Registered
Joined: 3/24/2022(UTC)
Posts: 1

by adding these two lines which is down below solved my problem.
Thanks

server.HeloDomain
server.MailFrom
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.060 seconds.

EXPLORE TUTORIALS

© All Rights Reserved, AIFEI Software Limited & AdminSystem Software Limited.