You are here: Re: Apache send mail and php « All PHP « IT news, forums, messages
Re: Apache send mail and php

Posted by Flamer on 07/19/06 04:18

wesley@ispace.co.za wrote:

> Yes, i am running my own server.
> How do i change the send mail configuration?
>
> this is my code:
>
> //email the password
> $to = "you@yourdomain";
>
> $sendmail_from = "me@mydomain";
> $subject = "hello";
>
>
> $body = "this is the body";
>
> if (mail($to,$subject,$body,$sendmail_from)){
> echo "sent";
>
> else {
> echo "mail not sent";
> }
>
>
>
>
> bizshop wrote:
> > Most likely it is in the sendmail configuration that needs to be
> > changed to allow you to send from another address.
> >
> > Are you running your own server where you can change the configuration?
> > Do you have your domain set up as a local host in sendmail?
> >
> > J.O. Aho wrote:
> > > wesley@ispace.co.za wrote:
> > > > Hi All, i am using a php script to send emails but i cannot seem to use
> > > > my own from_address as Apache keeps putting its own address, how do i
> > > > change that? I have looked in the httpd.conf but the changes that i
> > > > made do not seem to make a difference. Any suggestions?
> > > > Thanks Wes
> > > >
> > >
> > > You need to modify the mail header, to use your mail, with other words fix
> > > your php script.
> > >
> > >
> > > //Aho

you need to specify 'from: your@email.com' like this: (from php.net)

$to = 'nobody@example.com';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: webmaster@example.com' . "\r\n" .
'Reply-To: webmaster@example.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();

mail($to, $subject, $message, $headers);

Flamer.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация