RE: [PHP] Problem with mail()

2001-09-29 Thread Michael Katz

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

-Original Message-
From: ReDucTor [mailto:[EMAIL PROTECTED]]
Sent: Sunday, July 29, 2001 10:28 AM
To: Martín Marqués; [EMAIL PROTECTED]
Cc: [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" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[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 = "[EMAIL PROTECTED]";
> >
> > mail($to,$subject,$news, "From: yis <[EMAIL PROTECTED]>");
> > print ("See Events");
> > ?>
> >
> > 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  |[EMAIL PROTECTED]
> Programador, Administrador, DBA |   Centro de Telematica
>Universidad Nacional
> del Litoral
> -
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Problem with mail function

2001-03-26 Thread Carsten Gehling

From: "Sonya Davey / QDCEL" <[EMAIL PROTECTED]>
Sent: Monday, March 26, 2001 10:55 AM


> 1.What must I configure thse settings in my php.ini file to?
> SMTP = localhost
> sendmail_from = [EMAIL PROTECTED]

SMTP must be set to the address of a SMTP-server (Simple Mail Transfer
Protocol) - that is a server through which you can send mail. If this
Windows98 machine of yours is your personal and you connect to the internet
through a dialup connection, try to use the same server which is specified
in your mail-program.

It is because of this setting that your code fails to execute. It tries to
connect to a SMTP service on "localhost" which is your own machine.
Windows98 doesn't have a SMTP-service installed per default.

- Carsten




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Problem with mail function

2001-03-26 Thread Ankur Verma

The mail function uses the specified SMTP mail server to send out the mail.

you will need to set the php.ini variables as follows

SMTP=   localhost   ; The name or IP address of the 
machine which is running
the SMTP Server. for ex ; 
mail.flashmail.com

sendmail_from   =   [EMAIL PROTECTED]; The address that you want to appear 
in
the From Field of the mail.


The error you are getting is most probably because of the fact that there is
no SMTP server running on the machine specified in the above SMTP setting.

take a look at the following link for more info on the mail function -

http://www.php.net/manual/en/function.mail.php

hope that helps

regards

Ankur Verma
HCL Technologies
Noida
Uttar Pradesh
India


-Original Message-
From: Sonya Davey / QDCEL [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 26, 2001 2:25 PM
To: '[EMAIL PROTECTED]'
Subject: [PHP] Problem with mail function


Hi, Can anyone help me the mail function.

I am using PHP 4.04, on Windows 98,with PWS.

1.What must I configure thse settings in my php.ini file to?
SMTP=   localhost
sendmail_from   =   [EMAIL PROTECTED]
2.Why does this code give me the following error?
Warning: Failed to Connect
Code:

  $to = '[EMAIL PROTECTED]';
  $from = '[EMAIL PROTECTED]';
  $body = $MainAgentCode;
  $headers = "From: $from";
  $success = mail($to, "Inpro Web site", $body, $headers);
  if ($success)
 {//begin
  echo "Thank you for your input\n";
  }//end

e{ 
  echo "Error \n"; 
} 

Thanks to anyone who can help.
Sonya

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]