Justtechjobs.com Find a programming school near you






Online Campus Both


php-general | 2001092

RE: [PHP] Problem with mail() From: Michael Katz (mike <email protected>)
Date: 09/29/01

Good call, rtrim() seems to have brought back my sanity!

-----Original Message-----
From: ReDucTor [mailto:sjdtmv <email protected>]
Sent: Sunday, July 29, 2001 10:28 AM
To: Martín Marqués; mike <email protected>
Cc: php-general <email protected>
Subject: Re: [PHP] Problem with mail()

You might want to check if there is a newline at the end, you should do
rtrim() when you draw the subject from the db
----- Original Message -----
From: "Martín Marqués" <martin <email protected>>
To: <mike <email protected>>
Cc: <php-general <email protected>>
Sent: Sunday, September 30, 2001 12:24 AM
Subject: Re: [PHP] Problem with mail()

> On Sáb 29 Sep 2001 10:47, you wrote:
> > I am using this simple script:
> >
> > ?PHP
> > global $id, $subject, $news;
> > $database="yisny";
> > include ("yisny_db.inc");
> > db_connect ($database);
> > print ("$id");
> > $query = "select news_id, summary, news from news where news_id=$id";
> >
> > $result = mysql_query ($query)
> > or die ("sorry");
> >
> > $row = mysql_fetch_array ($result);
> > $news =strip_tags(stripslashes($row["news"]));
> > $subject= strip_tags(stripslashes($row["summary"]));
> > $to = "mike <email protected>";
> >
> > mail($to,$subject,$news, "From: yis <yir <email protected>>");
> > print ("<a href=/yisny/whatsnew.php>See Events</a>");
> > ?>
> >
> > Problem is that the from: header ends up in the body of the message.
>
> And what from do you get?
>
> > If I change $subject to "subject" (no variable) and $news to "news",
> > headers are fine.
>
> Could have something to do with quotes?
> Example:
> mail("martin","a test","this is a "test"","test")
>
> which should be:
>
> mail("martin","a test","this is a \"test\"","test")
>
> but this may not be your problem. I need more info.
>
> > I used to pass the variables between multiple html forms as globals and
> > hidden fields and I had no problems until the size of $message became
too
> > large. When it grew above 7kb or so the subject header would disappear.
> >
> > At this point I would like to use the above script and have the from:
> > header appear as a header and not in the message body.
> >
> > Running Linux and PHP4.05
>
> You should think about upgrading.
>
> Saludos... :-)
>
> --
> Porqué usar una base de datos relacional cualquiera,
> si podés usar PostgreSQL?
> -----------------------------------------------------------------
> Martín Marqués | mmarques <email protected>
> Programador, Administrador, DBA | Centro de Telematica
> Universidad Nacional
> del Litoral
> -----------------------------------------------------------------
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe <email protected>
> For additional commands, e-mail: php-general-help <email protected>
> To contact the list administrators, e-mail: php-list-admin <email protected>
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe <email protected>
For additional commands, e-mail: php-general-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>