I am trying to setup my webpage with PHP and SMTP mail (without using
sendmail or any other local services).  I have been looking over all the
PHP documentation I can find, and I still can't get it to work (code
below).  If I telnet to James on port 25, the mail will send find, but I
can't get any data to show up with the PHP code below. I am wondering if
anyone has had similar problems with James and PHP SMTP or any clues?
Thanks.  

// open connection to smtpd on port 25 (fsockopen)
$fp = fsockopen("localhost", 25);
if (!$fp) { echo "Mail was not sent.  Please report send error to
webmaster.";}
//greet SMTP server (HELO)
fputs($fp, "HELO www.mydomain.com\n");
// set sender (MAIL FROM)
fputs($fp, "MAIL FROM: <[EMAIL PROTECTED]>\n");
// set recipient (RCPT TO)
fputs($fp, "RCPT TO: <[EMAIL PROTECTED]>\n");
// set mail body (DATA)
fputs($fp, "DATA\n");
fputs($fp, "To: toguy\nFrom: fromguy\n Subject:
coolsubject\n\ncoolmessage\n\n.\n");
// terminate (QUIT)
fputs($fp, "QUIT\n");
// close connection (fclose)
fclose($fp);

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.520 / Virus Database: 318 - Release Date: 9/18/2003
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to