You are here: Re: [PHP] Can't figure mail & post out « PHP « IT news, forums, messages
Re: [PHP] Can't figure mail & post out

Posted by Robert on 03/07/05 06:00

Thanks, I fixed the problem and it's working great. Didn't need the $_POST
in the email and needed double quotes around the sender header variable.


"Zareef Ahmed" <zareef.ahmed@gmail.com> wrote in message
news:ad1635c3050306190766154972@mail.gmail.com...
> Hi Robert,
>
> Please take a look at php manual and try to know something about
> $_POST, $_GET etc.
> Your code is full of errors.
>
>
> On Sun, 6 Mar 2005 15:33:30 -0500, Robert <sigler@cox.net> wrote:
>> Hi -
>>
>> I am very new to php and can't get this to work right. It keeps telling
>> me
>> there is no send header. I have tried multiple variations? Any ideas?
>> I
>> am simply trying to query the database and send out an email to each
>> person
>> in my database.
>>
>> Thanks,
>> Robert
>>
>> $query = "SELECT first_name, email FROM offer";
>> $result = @mysql_query ($query);
>>
>> if ($result) {
>> echo 'Mailing List...';
>> while ($row = mysql_fetch_array ($result, MYSQL_NUM)) {
> mysql_fetch_row can be an alternative.
>> $fname = "$row[0]";
>> $body = "<html><body>Hi {$_POST['fname']},</body></html>";
> You are sendting the email to users who are in the database, but
> greeting them with $_POST['fname']
>> $headers = "MIME-Version: 1.0\r\n";
>> $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
>> $headers .= "From: ";
> From is not set, value is not here.
>
>> $sendto = "$row[1]";
>> echo "<br>Row one output = $sendto<br>";
>> mail ($_POST['sendto'],'Testing', $body, $headers);
> Again you are sending the mail to same person very time.
>
>> echo "Sent to $row[1]<br>";}
> Again problem.
>> mysql_free_result ($result);
>>
>> --
>
> PHP manual is good thing to start .
> http://www.php.net
>
>
> zareef ahmed
>
> --
> Zareef Ahmed :: A PHP Developer in India ( Delhi )
> Homepage :: http://www.zareef.net

 

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

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