Re: mail function problem.
| From: | David Robley | Date: | Tue, 22 Aug 2000 01:06:03 +0000 |
| Subject: | Re: mail function problem. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-12853@lists.php.net to get a copy of this message | ||
On 21 Aug, chchar wrote:
> Hi,
>
> I having a problem on php mail() function. When I retrieve email address
> from database
> and sent email to recipient, the recipient will receive an email but is from
> nobody. And when I
> hard code recipient email address (eg chchar@mcms.com), it worked. The
> recipient will
> receive what is expected.
>
> Below is my example code. Hope somebody can help.
> Thank.
>
> <?
> $dbh =mysql_db_query("FIN","SELECT cor_email_c from my_table where
> name='ABC' ");
>
> ### the content for $recipient will be "abc@mcms.com"
> list($recipient) =mysql_fetch_array($dbh);
I don't think this is doing what you expect. echo the value of
list($recipient) and see what you get. More correctly, to get the email
address you then need to use
$mailto = $recipient["cor_email_c"];
>
> $subject="Reminder ....";
> $priority="Importance:High\nX-Priority:1\nX-MSMail-Priority:High";
> $message = "This is an automated email ....";
>
> ### This can't work.
mail("$mailto","$subject","$message","From:auto_email\r\n$header");
>
> ### This can work.
> $recipient="chchar@mcms.com";
>
> mail("$recipient","$subject","$message","From:auto_email\r\n$header");
> ?>
>
> Regards,
> Char
Do you suppose you could convince your mailer not to add this rubbish?
>
> begin 600 winmail.dat
>
> M>M>)\^(@,`
0:0"$`````!$0>0!@(```Y0``````#H$(@<`
Cheers
--
David Robley | WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/
AusEinet | http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA