PHP use's host+domainname. When sending mail from PHP I use something like
this.

Sean Truman
www.prodigysolutions.com
[EMAIL PROTECTED]
--- PHP starts here --------------------------------------------
<?
// Set SMTP server variables.
$smtp_server = "localhost";
$smtp_port = 25;

// Set Other SMTP server variables.
// Mail from
$mail_from = "[EMAIL PROTECTED]";
$mail_from_name = "Foo Man";

// Who  are we sending the mail too
$rcpt_to = "[EMAIL PROTECTED]";
$rcpt_to_name = "FooMan Two";

// The Subject
$subject = "This is an Information Request";

// This is the message..
$message="This is your message\n";

// Open TCP connection And send the mail.
$sock = fsockopen("$smtp_server",$smtp_port, &$errno, &$errstr,5);
if (!$sock) {
 echo "$errstr ($errno)<BR>\n";
} else {
 $recv = fgets($sock,1024);
 fputs ($sock, "HELO $mail_from\n");
 $recv = fgets($sock,1024);
 fputs ($sock, "MAIL FROM:<$mail_from>\n");
 $recv = fgets($sock,1024);
 fputs ($sock, "RCPT TO:<$rcpt_to>\n");
 $recv = fgets($sock,1024);
 fputs ($sock, "DATA\n");
 $recv = fgets($sock,1024);
 fputs ($sock, "From: \"$mail_from_name\"<$mail_from>\r\n");
 fputs ($sock, "To: \"$rcpt_to_name\"<$rpct_to>\r\n");
 fputs ($sock, "Subject: $subject\r\n");
 fputs ($sock, "\r\n$message\r\n");
 fputs ($sock, "\r\n.\r\n");
 $recv = fgets($sock,1024);
 fputs ($sock, "QUIT\r\n");
 $recv = fgets($sock,1024);
 fclose($sock);
}

?>
--- PHP ends here --------------------------------------------

----- Original Message -----
From: Andrew Richards <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, August 21, 2000 7:07 AM
Subject: Re: qmail uses FQDN when sending from PHP


> Jim,
>
> Hmm. It's not clear where your confusion lies. However, you may like
> to set control/defaulthost (that's normally
/var/qmail/control/defaulthost);
> here's the section of the qmail-inject man page:
> .       defaulthost
> .            Default host name.  Default: me, if that is supplied;
> .            otherwise  the  literal  name  defaulthost,  which is
> .            probably not what you want.  qmail-inject  adds  this
> .            name to any address without a host name.  defaulthost
> .            need not be the current host's  name.   For  example,
> .            you  may  prefer  that  outgoing  mail show just your
> .            domain name.

Reply via email to