Putting an fgets in there after every fputs worked.  I think it is
because the buffer still had some characters in it for some reason, so
it wasn't setting up the data fields right.  

This is apparently not a James problem.  I apologize for the
inappropriate post, but I didn't know beforehand.  

Thanks for the help.


-----Original Message-----
From: Fox Sterling [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, October 01, 2003 5:16 PM
To: James Users List
Subject: Re: SMTP with PHP

Have you tried reading the server responses with you PHP code?  I only
see
puts, and no gets.  Could it be possable there is either a server
problem,
or that maybe either the server or PHP mod is waiting for the get stream
to
be cleared?

// 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);

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

---
Incoming 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
 

---
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