[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 6022
  • Last Modified:

Relay Access Denied?

Hi experts,

i have created a program that will send emails, i followed the protocol for smtp, but when i get to the part of sending the RCPT TO: <email address>, i get a reply of "relay access denied". does anyone know what that means?  i don't know if i should match the smtp server address to the receipt address. i mean if i'm sending to a mail.com account then i should be using the smtp server for mail.com. or could i use just any smtp server. is there a way to obtain the smtp server address for a certain email address by just looking at the domain part?

thanks very much
neostre
0
neostre
Asked:
neostre
  • 3
  • 2
  • 2
  • +1
2 Solutions
 
PhilipStearsCommented:
Neostre

Many SMTP servers; in an effort to reduce spam and other abuses of the facilities; will prevent mail being sent from them to other domains unless you authenticate with the server first.

In order to send the message correctly, just authenticate with the server first, or choose a server that does not require authentication.

Hope this helps,

Phil
0
 
KavarCommented:
I think your relay problem is because you are sending to an email address that your smtp server does not consider local.  An example, your server hosts email addresses of itolm.com, you would not be able to use it to send email to microsoft.com,

make sure the email address your sending to is local to that smtp server, if your trying to send to an external email address, you will need to configure your mail server to allow you to do this (with either domain based exceptions, ip based relay exceptions, email forwarding accounts to name a few)
0
 
danielsonchrisCommented:
Here is an idea to help you fix this.  After coding many a smtp client out.  Most SMTP servers will allow you to relay if you at least authenticate with them using a simple Base64 algorithm.   Though if not, you may need to apply a cram-md5 or NTLM based on the mail server settings.

In order to try a basic base64 algo test try the following in your code.
after send the EHLO or HELO send an
"AUTH LOGIN\r\n".
After doing that
send the
"smtp_User_Name\r\n"

Then send the

"Base64Encoded_Password\r\n"

then move to your standard "MAIL From: ...."  call.
If you need anymore specifics please tell me the language you are using in order to supply you with some code examples.
-Chris
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
neostreAuthor Commented:
thanks for the info guys, i've been researching on this part, and i think ill go with the authentication part. although i still haven't tried it out yet. now my question would be what user name/password will i use? does that mean if i have a yahoo mail account, and i will send using that email address to an account in hotmail, i would need to use yahoo's smtp server and my username/password for me to be able to authenticate?
i am coding it using c++ language via the winsock api and not the mfc socket class.

any example would be highly appreciated, thanks in advance.

neostre
0
 
danielsonchrisCommented:
Now, I'm not sure how Yahoo handles it's emails and if you can get direct access to it's smtp services.  Is that the server you are having to test off of?  All my tests with hand rolling SMTP have been with a specific smtp server such as "sendmail" and "microsoft exchange".  So this "relay access denied" error is coming from a Yahoo server?  If so, then try the base64 technique.  Assuming you have already found the "relay access denied" using the above listed protocol will take you mere minutes to implement.
The only code you may need is a base64 encoder... let me know.. I'll track my old lib down.. or I'm sure you can find one easily using google.  ;)  
Regards,
   Chris
0
 
neostreAuthor Commented:
yahoo is just my example here, but i did tried it for yahoo once and it didn't work. i tried some other smtp server that i know of, i even tried my isp's smtp and it didn't also work . someone told me that i might try using "open smtp servers" which they say will probably allow my mail to go thru without any authentication. i'm still searching if it is possible or there is such a server. if anyone knows any let me know, i would like to try it out.

thanks,
neostre
0
 
KavarCommented:
if you specify your ISP, and you login, it will work fine
0
 
danielsonchrisCommented:
Wasn't authentication the solution?  I explained that clearly above and everything was left with:

"thanks for the info guys, i've been researching on this part, and i think ill go with the authentication part. although i still haven't tried it out yet. now my question would be what user name/password will i use? does that mean if i have a yahoo mail account, and i will send using that email address to an account in hotmail, i would need to use yahoo's smtp server and my username/password for me to be able to authenticate?
i am coding it using c++ language via the winsock api and not the mfc socket class.

any example would be highly appreciated, thanks in advance."


The points should be split up amongst those who helped.
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

  • 3
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now