Re: [PHP] PROBLEM WITH MAIL FUNCTION

2006-07-09 Thread Ligaya Turmelle

Juanjo Pascual wrote:

Hello,

I have a problem with the mail function when I send a mail with acents 
or Ñ in the subject. When I receive the mail this caracters have been 
replaced by X.


I'm using the mail function in this way:

mail([EMAIL PROTECTED], 'Consulta Señalítica desde la página web', 
'strongHola, esto es una pruebastrong','From: [EMAIL PROTECTED]' . \r\n 
. 'Content-type: text/html; charset=iso-8859-1' . \r\n);


The mail subject when I receive the message is like this: Consulta 
SeXalXtica desde la pXgina web


¿How can I solve this problem?

IIRC sending non-ascii chars in a header is outside the standard without 
some encoding.  This may help you - http://www.faqs.org/rfcs/rfc1522.html


--

life is a game... so have fun.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] PROBLEM WITH MAIL FUNCTION

2006-07-09 Thread Manuel Lemos
Hello,

Juanjo Pascual wrote:
 I have a problem with the mail function when I send a mail with acents 
 or Ñ in the subject. When I receive the mail this caracters have been 
 replaced by X.
 
 I'm using the mail function in this way:
 
 mail([EMAIL PROTECTED], 'Consulta Señalítica desde la página web', 
 'strongHola, esto es una pruebastrong','From: [EMAIL PROTECTED]' . \r\n 
 . 'Content-type: text/html; charset=iso-8859-1' . \r\n);
 
 The mail subject when I receive the message is like this: Consulta 
 SeXalXtica desde la pXgina web
 
 ¿How can I solve this problem?

Headers with non-ASCII characters must be encoded with q-encoding.

If you do not know how to encode headers that way, you may want to try
this class for composing and sending MIME messages that can encode
headers as needed. Take a look at the test_email_message.php example
script that shows how to send messages with accents like you are using:

http://www.phpclasses.org/mimemessage


-- 

Regards,
Manuel Lemos

Metastorage - Data object relational mapping layer generator
http://www.metastorage.net/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PROBLEM WITH MAIL FUNCTION

2006-07-06 Thread Martin Marques

On Thu, 6 Jul 2006, Juanjo Pascual wrote:


Hello,

I have a problem with the mail function when I send a mail with acents or Ñ 
in the subject. When I receive the mail this caracters have been replaced by 
X.


I'm using the mail function in this way:

mail([EMAIL PROTECTED], 'Consulta Señalítica desde la página web', 'strongHola, 
esto es una pruebastrong','From: [EMAIL PROTECTED]' . \r\n . 'Content-type: 
text/html; charset=iso-8859-1' . \r\n);


Worked great for me. But I would try with something more like this:

mail(mimail.midom.com,Consulta Señalítica desde la página web,
strongHola, esto es una pruebastrong,
	From: [EMAIL PROTECTED] \n Content-type: text/html; \n 
charset=iso-8859-1 \n);


--
 21:50:04 up 2 days,  9:07,  0 users,  load average: 0.92, 0.37, 0.18
-
Lic. Martín Marqués |   SELECT 'mmarques' ||
Centro de Telemática|   '@' || 'unl.edu.ar';
Universidad Nacional|   DBA, Programador,
del Litoral |   Administrador
-
-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Problem wih mail() and attachment

2006-03-28 Thread chris smith
On 3/27/06, Dennis N. [EMAIL PROTECTED] wrote:
 Hello,

 I have some trouble with sending emails with an MS word attachment. I let
 fill a word document from my php website. When it is finished with filling
 the information, the document is saved on the webserver and the word
 application will be closed by the website. So far so good. Now I want to
 send this created document to the user via the mail function. If I send an
 email without the attachment it works great. So there is no error with the
 SMTP server. But when I send this email with the attachment, the webserver
 breaks down and I receive no email. I can't see the error in the code. So
 perhaps someone can help me.

 Here is the code:

 
 $word-StatusBar = Fertig!; // Statusbar Ausgabe
 $word-ActiveDocument-SaveAs(d:\wwwRoot\Lieferprogramm\ProductPortfolio.doc);
 //$word-ActiveDocument-Save();
 $word-Documents-Close();
 $word-Quit();
 $word = null;
 $Empfaenger = [EMAIL PROTECTED];
 $Betreff = Product Portfolio;
 //$Dateiname = d:\\wwwRoot\\Lieferprogram\\ProductPortfolio.doc;
 $Dateiname = ProductPortfolio.doc;
 $DateinameMail = ProductPortfolio.doc;
 $Header = From: [EMAIL PROTECTED] [EMAIL PROTECTED];
 $Trenner = md5(uniqid(time()));
 $Header .= \n;
 $Header .= MIME-Version: 1.0;
 $Header .= \n;
 $Header .= Content-Type: multipart/mixed; boundary=\$Trenner\;
 $Header .= \n\n;
 $Header .= This is a multi-part message in MIME format;
 $Header .= \n;
 $Header .= --$Trenner;
 $Header .= \n;
 $Header .= Content-Type: text/plain; charset=\iso-8859-9\;
 $Header .= \n;
 $Header .= Content-Transfer-Encoding: 8bit;
 $Header .= \n\n;
 $Header .= Product Portfolio;
 $Header .= \n;
 $Header .= --$Trenner;
 $Header .= \n;
 $Header .= Content-Type: application/msword; name=\$DateinameMail\;
 $Header .= \n;
 $Header .= Content-Transfer-Encoding: base64;
 $Header .= \n;
 $Header .= Content-Disposition: attachment; filename=\$DateinameMail\;
 $Header .= \n\n;
 $Dateiinhalt = fread(fopen($Dateiname, r), filesize($Dateiname));
 $Header .= chunk_split(base64_encode($Dateiinhalt));

The file doesn't go in the header, it goes in the body.

Can I ask why you're not using something like phpmailer
(http://phpmailer.sf.net) ?

--
Postgresql  php tutorials
http://www.designmagick.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Problem with mail() on Debian

2006-02-23 Thread Jochem Maas

George Pitcher wrote:

Manuel,



I have found that any changes I make to php.ini are ignored, even after
restarting Apache. I have been editing httpd.conf via Webmin,


personally I'd rather stick my head in a blender than use webmin to edit
such conf files. (no I wouldn't but you get the point hopefully)

how are you restarting apache? possibly your being told that the restart
occured but really your being lied to ... try doing it 'manually':

e.g.:

? apachectl stop; sleep 5; apachectl start





which for most


configs works fine (and is displayed in phpinfo(), the sendmail


changes are


never displayed (always shows sendmail_path = /usr/sbin/sendmail).


until the sendmail_path changes when you view
phpinfo() your updated php.ini has not been read in - for whatever
reason.



There are no miracles. If you change restarted Apache and phpinfo()
shows the same in sendmail_path, either you have other Apache
configuration changing PHP options, or you have not really changed
php.ini, which is very likely.

No, I am not saying you are crazy. It is very likely that the real
php.ini is not in the path you think it is. This may happen if you have
installed Zend Studio or some other tool that needs to replace the real
php.ini and moves it elsewhere.

Look again to the phpinfo() output to determine the real path of php.ini .



That's the crazy part! phpinfo() shows the path to the php.ini file as the
one that I have been editing, and if I open that file in vi, it shows all
the changes I've made. This is a bare debian install in as much as it has no
windowing environments. No Zend Studio, or anything else fancy. Smarty and
PEAR work, its just the emailing that is letting me down just now. Once
that's resolved I'll move on to spreadsheet reading.

Cheers

George



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Problem with mail() on Debian

2006-02-23 Thread George Pitcher
Jochem,


 personally I'd rather stick my head in a blender than use webmin to edit
 such conf files. (no I wouldn't but you get the point hopefully)

 how are you restarting apache? possibly your being told that the restart
 occured but really your being lied to ... try doing it 'manually':

 e.g.:

 ? apachectl stop; sleep 5; apachectl start


Webmin was a means to an end. Your restarting method solved the problem of
php.ini being read (or at least being displayed in phpinfo()), but doesn't
get round my email problem.

 My apache error.log says:

sh: line 1: /usr/sbin/sendmail -t: no such file or directory

 if I replace sendmail with exim4, i get an equivalent error.

ls -l sendmail in /usr/sbin gives me:
lrwxrwxrwx  1 root root 5 2005-11-17 15:51 sendmail - exim4

Any (constructive) thoughts?

Cheers

George

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Problem with mail() on Debian

2006-02-23 Thread John Nichel

George Pitcher wrote:

Jochem,


personally I'd rather stick my head in a blender than use webmin to edit
such conf files. (no I wouldn't but you get the point hopefully)

how are you restarting apache? possibly your being told that the restart
occured but really your being lied to ... try doing it 'manually':

e.g.:

? apachectl stop; sleep 5; apachectl start



Webmin was a means to an end. Your restarting method solved the problem of
php.ini being read (or at least being displayed in phpinfo()), but doesn't
get round my email problem.

 My apache error.log says:

sh: line 1: /usr/sbin/sendmail -t: no such file or directory

 if I replace sendmail with exim4, i get an equivalent error.

ls -l sendmail in /usr/sbin gives me:
lrwxrwxrwx  1 root root 5 2005-11-17 15:51 sendmail - exim4

Any (constructive) thoughts?


Permissions on exim4?

Oh, and don't use Webmin.  ;)

--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Problem with mail() on Debian

2006-02-23 Thread Manuel Lemos
Hello,

on 02/23/2006 11:32 AM George Pitcher said the following:
  My apache error.log says:
 
 sh: line 1: /usr/sbin/sendmail -t: no such file or directory

/usr/sbin/sendmail is not the correct sendmail program path. The correct
path is /usr/lib/sendmail . It may be odd that a program is located in
/usr/lib but that has always been the standard path for sendmail and
compatible MTA. Sometimes it is a symbolic link to /usr/sbin/sendmail
but that is not necessarily true.

-- 

Regards,
Manuel Lemos

Metastorage - Data object relational mapping layer generator
http://www.metastorage.net/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Problem with mail() on Debian

2006-02-22 Thread Jochem Maas

George Pitcher wrote:

Hi,

I am in the process of moving from Windows (NT/XP) to Linux. I'm starting
with a new small application which I have working on my Windows XP laptop.

On my Linux box, I have php.ini saying:


search this page for 'exim' - it should help:

http://php.net/mail



sendmail_path /usr/sbin/sendmail


this may need to become:

sendmail_path /usr/sbin/sendmail -t

and it may require quotes:

sendmail_path /usr/sbin/sendmail -t



That 'sendmail' is a symbolic link to exim4 in the same directory. I can
send mail using exim4 from the command line, but not using PHP. I couldn't
find anything in the manual or on Google that helps me solve the problem.

Can anyone give me a clue where to look to solve this problem?

Cheers

George, in Oxford



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Problem with mail() on Debian

2006-02-22 Thread George Pitcher
Jochem,

Thanks, but I tried that and it made no difference.

I have found that any changes I make to php.ini are ignored, even after
restarting Apache. I have been editing httpd.conf via Webmin, which for most
configs works fine (and is displayed in phpinfo(), the sendmail changes are
never displayed (always shows sendmail_path = /usr/sbin/sendmail).

Cheers

George

 -Original Message-
 From: Jochem Maas [mailto:[EMAIL PROTECTED]
 Sent: 22 February 2006 7:01 pm
 To: George Pitcher; [php] PHP General List
 Subject: Re: [PHP] Problem with mail() on Debian


 George Pitcher wrote:
  Hi,
 
  I am in the process of moving from Windows (NT/XP) to Linux.
 I'm starting
  with a new small application which I have working on my Windows
 XP laptop.
 
  On my Linux box, I have php.ini saying:

 search this page for 'exim' - it should help:

 http://php.net/mail

 
  sendmail_path /usr/sbin/sendmail

 this may need to become:

   sendmail_path /usr/sbin/sendmail -t

 and it may require quotes:

   sendmail_path /usr/sbin/sendmail -t

 
  That 'sendmail' is a symbolic link to exim4 in the same directory. I can
  send mail using exim4 from the command line, but not using PHP.
 I couldn't
  find anything in the manual or on Google that helps me solve
 the problem.
 
  Can anyone give me a clue where to look to solve this problem?
 
  Cheers
 
  George, in Oxford
 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Problem with mail() on Debian

2006-02-22 Thread Manuel Lemos
Hello,

on 02/23/2006 03:55 AM George Pitcher said the following:
 Jochem,
 
 Thanks, but I tried that and it made no difference.
 
 I have found that any changes I make to php.ini are ignored, even after
 restarting Apache. I have been editing httpd.conf via Webmin, which for most
 configs works fine (and is displayed in phpinfo(), the sendmail changes are
 never displayed (always shows sendmail_path = /usr/sbin/sendmail).

There are no miracles. If you change restarted Apache and phpinfo()
shows the same in sendmail_path, either you have other Apache
configuration changing PHP options, or you have not really changed
php.ini, which is very likely.

No, I am not saying you are crazy. It is very likely that the real
php.ini is not in the path you think it is. This may happen if you have
installed Zend Studio or some other tool that needs to replace the real
php.ini and moves it elsewhere.

Look again to the phpinfo() output to determine the real path of php.ini .

-- 

Regards,
Manuel Lemos

Metastorage - Data object relational mapping layer generator
http://www.metastorage.net/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Problem with mail() on Debian

2006-02-22 Thread George Pitcher
Manuel,

  I have found that any changes I make to php.ini are ignored, even after
  restarting Apache. I have been editing httpd.conf via Webmin,
 which for most
  configs works fine (and is displayed in phpinfo(), the sendmail
 changes are
  never displayed (always shows sendmail_path = /usr/sbin/sendmail).

 There are no miracles. If you change restarted Apache and phpinfo()
 shows the same in sendmail_path, either you have other Apache
 configuration changing PHP options, or you have not really changed
 php.ini, which is very likely.

 No, I am not saying you are crazy. It is very likely that the real
 php.ini is not in the path you think it is. This may happen if you have
 installed Zend Studio or some other tool that needs to replace the real
 php.ini and moves it elsewhere.

 Look again to the phpinfo() output to determine the real path of php.ini .

That's the crazy part! phpinfo() shows the path to the php.ini file as the
one that I have been editing, and if I open that file in vi, it shows all
the changes I've made. This is a bare debian install in as much as it has no
windowing environments. No Zend Studio, or anything else fancy. Smarty and
PEAR work, its just the emailing that is letting me down just now. Once
that's resolved I'll move on to spreadsheet reading.

Cheers

George

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] problem with Mail function

2006-02-05 Thread sub
This may be a bit to obvious, but I miss little stuff all the time.

You wouldn't happen to have the if(mail(...)) in some form of loop would
you?

or perhaps $to is getting assigned the e-mail address like
[EMAIL PROTECTED] [EMAIL PROTECTED] can you check the value of $email
before you assign it?



~Drew
www.drewpydraws.com


- Original Message - 
From: Tariq Dalvi [EMAIL PROTECTED]
To: php-general@lists.php.net
Sent: Sunday, February 05, 2006 6:55 PM
Subject: [PHP] problem with Mail function


 Hello everyone,

 I m using php mail function it dose everyting fine besides it prints
 message twise in the email body can someone please have a look
 what i m doing wrong the code is as follows :

 $to = $email;
 $subject = someting goes here \n\n;
 $headers = From: [EMAIL PROTECTED] .
 X-Mailer: Mailserver at somewhere.com\n .
 Date: $date\n .
 MIME-Version: 1.0\n .
 Content-Type: text/plain; charset=ISO-8859-1\n ;

 message EOF
 ...
 ...
 .
 .
 ...
 EOF;

   if (mail($to,$subject,$message,$headers)){

 $say = p /E Mail sent successfully to $email. br;
}
 else{

 $say = \n\np /Ohoho! Sending failed Please inform to Webmaster. br;

 }

 I shall highly appreciate any help

 Thanks
 Tariq

 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php





 -- 
 No virus found in this incoming message.
 Checked by AVG Free Edition.
 Version: 7.1.375 / Virus Database: 267.15.2/251 - Release Date: 2/4/2006



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] problem with Mail function

2006-02-05 Thread sunaram patir
Dude,
Do not use $to = $email; instead $to=$email;
But i didn't even know what is your problem!
On 2/6/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 This may be a bit to obvious, but I miss little stuff all the time.

 You wouldn't happen to have the if(mail(...)) in some form of loop would
 you?

 or perhaps $to is getting assigned the e-mail address like
 [EMAIL PROTECTED] [EMAIL PROTECTED] can you check the value of $email
 before you assign it?



 ~Drew
 www.drewpydraws.com


 - Original Message -
 From: Tariq Dalvi [EMAIL PROTECTED]
 To: php-general@lists.php.net
 Sent: Sunday, February 05, 2006 6:55 PM
 Subject: [PHP] problem with Mail function


  Hello everyone,
 
  I m using php mail function it dose everyting fine besides it prints
  message twise in the email body can someone please have a look
  what i m doing wrong the code is as follows :
 
  $to = $email;
  $subject = someting goes here \n\n;
  $headers = From: [EMAIL PROTECTED] .
  X-Mailer: Mailserver at somewhere.com\n .
  Date: $date\n .
  MIME-Version: 1.0\n .
  Content-Type: text/plain; charset=ISO-8859-1\n ;
 
  message EOF
  ...
  ...
  .
  .
  ...
  EOF;
 
if (mail($to,$subject,$message,$headers)){
 
  $say = p /E Mail sent successfully to $email. br;
 }
  else{
 
  $say = \n\np /Ohoho! Sending failed Please inform to Webmaster. br;
 
  }
 
  I shall highly appreciate any help
 
  Thanks
  Tariq
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
 
 
  --
  No virus found in this incoming message.
  Checked by AVG Free Edition.
  Version: 7.1.375 / Virus Database: 267.15.2/251 - Release Date: 2/4/2006
 
 

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] problem with mail() and attachment

2005-03-01 Thread AdamT
On Sun, 27 Feb 2005 08:23:26 +0100, Stefan Sturm [EMAIL PROTECTED] wrote:
 Hi,
 
 I'm using the script below to send ascii files attached to mails via mail().
snip
 Has anybody got an idea where the problem could be?
 
It appears that your mailserver has developed a fault and is sending
all messages out two or three times.
-- 
AdamT
Justify my text?  I'm sorry, but it has no excuse.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] problem with mail()

2005-03-01 Thread Richard Lynch
Stefan Sturm wrote:
 I'm using the script below to send ascii files attached to mails via
 mail().
 I'm running the script on different servers and it works fine. Now I got a
 problem on windows server 2003. The attachment of the mail is disturbed,
 the
 first 76 characters are missing, the rest of the attachment is correct.
 When
 I looked at the mail headers of the mail I recieved I recognized that
 there
 were some lines missing. Also the first line of the attachment part in the
 header is mssing. As I use chunk_split without the chunklen paramter the
 lines are all 76 characters long. So it just looks like that the server
 ommits lines in the header. I marked the missing lines in the script with
 comments. Has anybody got an idea where the problem could be?

 Thank in advance

 Stefan

   $unique_sep =md5(uniqid(time()));
   $headers = From: egrade questionaire\n;
   $headers .= MIME-Version: 1.0\nContent-Type:
 multipart/mixed;boundary=\$unique_sep\;\n;

 #The second \n at the end of the next command is ommited, the resulting
 empty line is not in the header of the received mail
   $headers .=
 charset=\iso-8859-1\\nContent-Transfer-Encoding:7bit\n\n;

Email headers, by definition, end when a blank line is sent.

So you're really cramming the BODY of your message into the headers
through the PHP mail function.

It happens by sheer good luck to work on some systems, since the
resulting composition ends up *LOOKING* like a valid email, even though
you routed your body through the headers.

That doesn't make it valid.

Everything after the \n\n should be moved to the body you pass to PHP's
mail  function.


-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Problem sending mail

2004-08-30 Thread Jason Wong
On Tuesday 31 August 2004 05:02, Zoran Lorkovic wrote:
 $file = file_get_contents(text.inc);
 $start = [start];
 $end = [/end];
 $pos_start = strpos ($file, $start);
 $pos_end = strpos ($file, $end);
 $data = substr ($file, $pos_start, $pos_end);
 mail ([EMAIL PROTECTED], My Subject, $data);


 This code works when I call it from browser, but when I call it from
 command line, $data is not put into mail (mail is send but it is empty,
 without any data in body).

 File text.inc looks like this:
 [start]some_text_goes_here[/end]
 [other_start]other_text_goes_here[/other_end]

0) Enable full error reporting
1) Stop repeating yourself
2) I think we've ascertained from your previous post that mail() is working
3) Are you saying that $data contains what you expected but when plugged into 
mail() it becomes empty?

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
An idle mind is worth two in the bush.
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Problem with mail()

2004-06-17 Thread John Nichel
Keith Aldridge wrote:
New to php, can't see the problem with mail().
snip
?php
if (mail($to, $subj, $body)) {
echo (Successful send);
}
else {
echo (Failed);
}
?
Please don't send email to a mailing list asking for read reciepts.
Can the box that you're testing this script on send mail outside of 
localhost?

--
John C. Nichel
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Problem with mail()

2004-06-17 Thread Ashwin Purohit
So what do you get as the error message? Does it just return failed?
Also, I think using parentheses with echo statements like yours is
unnecessary.

 Keith Aldridge wrote:
 New to php, can't see the problem with mail().

?php
 if (mail($to, $subj, $body)) { echo Successful send; }
 else { echo Failed; }
 ?

-- 
Ashwin Purohit

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Problem with mail()

2004-06-17 Thread qwerty
This should work:

if (mail($to, $subj, $bodytext)) {
echo Mail send;
} else {
echo ... something go wrong: 
}

One tip: when configuring/installing php, if there is not /usr/bin/sendmail
it asumes that there is no way of send mails so mail function always return
false, check that just in case.

 So what do you get as the error message? Does it just return failed?
 Also, I think using parentheses with echo statements like yours is
 unnecessary.
 
 Keith Aldridge wrote:
 New to php, can't see the problem with mail().
 

 
 -- 
 Ashwin Purohit
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Problem with mail()

2004-06-17 Thread Curt Zirzow
* Thus wrote Keith Aldridge ([EMAIL PROTECTED]):
 New to php, can't see the problem with mail().
 
  
 
 Server running 4.0.0
 
 Path to sendmail: /var/sbin/sendmail

Please don't double/quad space, it makes things hard to read

 ...
 
 if (mail($to, $subj, $body)) {
 
 echo (Successful send);
 ...
 
 any / all suggestions would be greatly appreciated, I'm having no luck
 with tech support at the ISP.

any suggestions for what? 

The only thing i have to say is that mail() return's success when
the MTA (sendmail) has succesfully accepted the message. and not
necessarily that it was sent to the recipient.

Curt
-- 
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about.  No, sir.  Our model is the trapezoid!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Problem with mail() function and exec

2003-11-26 Thread Rasmus Lerdorf
Do you have /bin/sh inside your jail?

On Thu, 27 Nov 2003, th3 th1nk3r wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 Hi,
 I have a great problem. I hava an apache 1.3.28 + php 4.3.3 installation into 
 a chroot jail in my Linux box. Into the jail I have installed postfix (with 
 his sendmail executable) and I can send mails with it (I run it like a chroot 
 user to test it). But, with a simple script like this doesn't work:
 
 ?php
 if(mail([EMAIL PROTECTED],hello world!!,Msg))
 echo OK;
 else
 echo Opsss!!!;
 ?
 
 If I run apache from outside the jail, the scripts runs perfectly and send the 
 mail, but inside it doesn't send anything (php don't exec the program 
 sendmail).
 I have the same config in and out the jail, the execs have root like owner (I 
 have test it with apache like owner, but doesn't work) I have test it with 
 safe_mode on and off, with safe_mode_exec_dir and sendmail_path, but don't 
 work.
 
 The run functions like exec, don't work. I'm curious because don't work inside 
 and outside the jaul, but the mail function works outside. I have test it 
 with a script that works in an old install of php.
 
 The mail perhaps could function with sockets and contacting the localhost smtp 
 server, but I continu with the exec problem. I think of it like a security 
 problem, because I don't know why is failing.
 
 Any Idea? suggestions?
 
 sorry for my bad english, and thanks ;)
 Byez
 - -- 
 - ---
   Jabber ID: [EMAIL PROTECTED]
   GNU/Linux User# 266578
   http://www.blacklord.net/
 
  -BEGIN GEEK CODE BLOCK-
   Version: 3.1
   GCS/CM d-- s: a? C UL+++ P ++ L+++ E--- W+++ N-- o-- K--- w--- O M- V- 
 PS+++ PE-- Y++ PGP+++ t+ 5+ X+++ R+++ tv-- b++ DI++ D++ G e+++ h r++ y+
  --END GEEK CODE BLOCK--
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.2.2 (GNU/Linux)
 
 iD8DBQE/xU2pXlg6KvYpupERAlDrAJ9Wc7UW7gEj8dJViFQG1g38lOcV+gCgkrIg
 4Ysp0QFLZruAWlWh4pBs9Qs=
 =RiOv
 -END PGP SIGNATURE-
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Problem with mail() function and exec

2003-11-26 Thread th3 th1nk3r
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Stardate Thursday 27 November 2003 02:08
Capt. Lord th1nk3r
Class C-1 msg from Rasmus Lerdorf
 Do you have /bin/sh inside your jail?

Thanks
I'm stupid. It was that easy. Thanks again ;)
- -- 
- ---
  Jabber ID: [EMAIL PROTECTED]
  GNU/Linux User# 266578
  http://www.blacklord.net/

 -BEGIN GEEK CODE BLOCK-
  Version: 3.1
  GCS/CM d-- s: a? C UL+++ P ++ L+++ E--- W+++ N-- o-- K--- w--- O M- V- 
PS+++ PE-- Y++ PGP+++ t+ 5+ X+++ R+++ tv-- b++ DI++ D++ G e+++ h r++ y+
 --END GEEK CODE BLOCK--
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQE/xWKYXlg6KvYpupERAsQrAJ9zUKIacQZzuTAzN14tembqK0+2uwCcCvTV
WxZ3K2COKmeQzJHXiYM9fc8=
=Fq60
-END PGP SIGNATURE-

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] problem with mail()

2002-08-16 Thread Analysis Solutions

On Wed, Aug 14, 2002 at 10:04:46AM -0700, Gui Guy wrote:
 
 ...: SYSERR(nobody): Can't create transcript file ./xfg7E9Jlr03988:
 Permission denied
 : SYSERR(nobody): Cannot create ./dfg7E9Jlr03988: Permission denied
 
 Does it mean that php is trying to send mail from user nobody?

Good guess!  Sounds like a file permissions thing.  What directory are
those files being created in?  Provide nobody with adequate permissions
on that directory.

--Dan

-- 
   PHP classes that make web design easier
SQL Solution  |   Layout Solution   |  Form Solution
sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




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 (a href=/yisny/whatsnew.phpSee 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  |[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 "BCENTERThank you for your input/CENTER/B\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]