Given an email as raw text, how can I send it using PHP?
I had the same problem but found a solution that seams to work. Open a socket in PHP and “telnetting” the raw emaildata. Something like this: $lSmtpTalk = array( array(‘220’, ‘HELO my.hostname.com’.chr(10)), array(‘250’, ‘MAIL FROM: [email protected]’.chr(10)), array(‘250’, ‘RCPT TO: [email protected]’.chr(10)), array(‘250’, ‘DATA’.chr(10)), array(‘354′, $lTheRawEmailStringWithHeadersAndBody.chr(10).’.’.chr(10)), array(‘250’, ‘QUIT’.chr(10)), array(‘221’, ”)); $lConnection = fsockopen(‘mail.anotherhost.dk’, 25, $errno, $errstr, 1); … Read more