Solved

Relay Access Denied?

Posted on 2004-04-10
11
6,018 Views
Last Modified: 2013-11-13
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
Comment
Question by:neostre
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +1
11 Comments
 

Expert Comment

by:PhilipStears
ID: 10797810
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
 
LVL 10

Expert Comment

by:Kavar
ID: 10799426
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
 
LVL 5

Expert Comment

by:danielsonchris
ID: 10801518
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:neostre
ID: 10801558
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
 
LVL 5

Accepted Solution

by:
danielsonchris earned 25 total points
ID: 10803167
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
 

Author Comment

by:neostre
ID: 10807004
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
 
LVL 10

Assisted Solution

by:Kavar
Kavar earned 25 total points
ID: 10807193
if you specify your ISP, and you login, it will work fine
0
 
LVL 5

Expert Comment

by:danielsonchris
ID: 11044127
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

687 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question