Justtechjobs.com Find a programming school near you






Online Campus Both


php-general | 2001062

RE: [PHP] SMTP/mail question From: mailing_list <email protected>
Date: 06/22/01

Hi!

I did it!
once again what I wanted to do:
I wanted to send a mail, but use "MAIL FROM:" and "RCPT TO:" from the
SMTP-Protocol and check, if the domain is accepted (nslookup MX)!
I had a perl script, that does this trick. Unfortunately the php-mail()
can't do a "RCPT TO:" and "MAIL FROM:" explicitly (would be great in a future
release!!!) !

for them who don't know:

--
telnet mymailserver 25
HELO localhost
MAIL FROM: realsender <email protected>
RCPT TO: realrecipient <email protected>
DATA
To: niceaddress <email protected>
From: niceaddress <email protected>
Subject: TESTMAIL

This is the Body ... . -- the result: .) if address is correct: mail will be delivered to realrecipient <email protected>, though in the To: header is written something else. .) if there is no user realrecipient at you.com, the mail will be resent to realsender <email protected> (Delivery-Error), though in the From: header is written something else. .) if the domain you.com doesn't exist or doesn't have a valid MX-entry, then the RCPT TO: isn't accepted and the mail won't be sent!!!

what I did (my sendmail.pl handles 1.RCPT TO, MAIL FROM;2.Mail Headers;3.Mail Body - all stored in $message): $fh=popen("scripts/sendmail.pl","w"); fwrite($fh,$message); if (pclose($fh)==0){ echo "Mail was sent successful!"; }else{ echo "Couldn't deliver mail (none or wrong MX-entry)!"; }

michi

-- GMX - Die Kommunikationsplattform im Internet. http://www.gmx.net

-- GMX Tipp:

Der zweitgrößte Lotto-Jackpot aller Zeiten: 36 Mio. DM suchen einen Gewinner! Jetzt online tippen und nebenbei noch eine Reise nach Las Vegas gewinnen! http://www.get1.de/gmx-gewinnspiel2

-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe <email protected> For additional commands, e-mail: php-general-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>