|
-
October 29th, 2005, 06:44 AM
#1
Getting servers for sending mail via SMTP
I have looked in this article:
http://www.codeguru.com/Cpp/I-N/inte...icle.php/c6177
It shows how to send mail via SMTP.
However, in order to send email I need to connect to a server via mail.connect().
My question is, how do I get the available server on the computer the program runs (the client)?
Thanks in advance.
-
October 29th, 2005, 07:24 AM
#2
Re: Getting servers for sending mail via SMTP
Well, how do you know who the message is coming from? Either it is predefined, in which case you should already know the SMTP server or you need to get a "From" address from the user at which time you would need to get the SMTP connect info from the user as well.
-
October 29th, 2005, 11:41 AM
#3
Re: Getting servers for sending mail via SMTP
-
October 31st, 2005, 04:34 PM
#4
Re: Getting servers for sending mail via SMTP
It can be done.
You should extract the FQDN (domain name) of the recipient mail address, and then lookup its MX record (in DNS). The MX record contains a hostname which is resolved into an IP for the recipient's mail server (SMTP).
NOTE: For security reasons, most SMTP servers will perform a reverse DNS lookup of the calling IP address and then use the FQDN to lookup the MX. If the calling IP doesn't have a MX record, it will most likely reject it.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|