[NTLUG:Discuss] Qmail and php questions

Greg Edwards greg at nas-inet.com
Fri Feb 14 09:42:32 CST 2003


m m wrote:
>> From: Jack Snodgrass <jack+ntlug at mylinuxguy.net>
>> > >
>> > I should say I want call mail() function on php page.
>> >
>>
>> you use the php.ini file to say if you want to
>> 1) Call the sendmail prorgram directly. You have to tell where
>>    you have the sendmail executable located.
>> 2) use a remote SMTP Server. If you go this route, then
>>    you tell it the ip address of the remote server.
>>
>> I think that you want to do #2.
>>
>> Then on your .php page, you set up a form that when
>> run will do someting like:
>> $rc = mail($to_user, $subject, $msg_body, $mailheaders);
>> if($rc)
>>    $mail_message_confirmation = "E-mail has been sent.";
>> else
>>    $mail_message_confirmation = "E-mail send <b>FAILED</b>.";
>>
>> you use the form to get the $to_user, $subject, $msg_body, etc
>> info.
>>
>> jack
>>
> 
> yes, I want to use #2, but look at the code, how does the php mail() 
> knows where get connect to mail/smtp server on Linux system?
> 
> a lot of document 'says' put the sandmail path in the php.ini file. ok, 
> this means you HAVE TO to have mail server runs in the SAME BOX. is it 
> the same as #1 soluation. I know it. but this is not want I am looking for.
> 
> Thanks Rob Apodaca's advice for my question 1.
> 

Rob,

sendmail does NOT have to be running as a mail server to process single 
mail messages.  The mail program uses sendmail as a local process simply 
to handle delivering the mail.  Sendmail knows how to find a mail server 
to deliver the mail and the mail program doesn't.  Simply install 
sendmail and use mail.  IIRC, for this setup you don't even have to 
configure sendmail, it just needs to be there.  You might need to setup 
a host masquerade but that would be about it.

-- 
Greg Edwards
New Age Software, Inc.
http://www.nas-inet.com




More information about the Discuss mailing list