Re: how to pass authentication info to SMTP server
| From: | Franklin van Velthuizen | Date: | Fri, 07 Sep 2001 15:17:49 +0000 |
| Subject: | Re: how to pass authentication info to SMTP server | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-66414@lists.php.net to get a copy of this message | ||
"Balaji Ankem" <balaji.ankem@wipro.com> wrote in message
news:01bc01c137e0$280b0f60$1702910a@wipro.com...
> Hi friends,
> I would like to implement sending an e-mail through SMTP server.
>
> Here my SMTP server needs authentication.
>
> How to pass the username and password to SMTP server??
>
Do something similar:
$username = "foo";
$password = "bar";
$fp = fsockopen ($hostname, 110, $errno, $errstr, 30) or die("could not
connect");
fwrite($fp, "USER ".$username."\r\n");
fwrite($fp, "PASS ".$password."\r\n");
For more info about the protocol, take a look here:
http://www.cis.ohio-state.edu/cgi-bin/rfc/rfc1939.html
/ franklin