PHP Email form not sending mail to recipient

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
mdgroot
Posts: 155
Joined: Wed 11. Feb 2004, 17:47
Location: Netherlands

Post by mdgroot »

I don't know why, but not it IS working ! :lol:
User avatar
Oliver Georgi
Site Admin
Posts: 9949
Joined: Fri 3. Oct 2003, 22:22
Location: Dessau-Roßlau
Contact:

Post by Oliver Georgi »

based on the change of my last post? Please tell what you have changed.

Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn
mdgroot
Posts: 155
Joined: Wed 11. Feb 2004, 17:47
Location: Netherlands

Post by mdgroot »

Yep. I changed line 217 to (according to your last post);

Code: Select all

if(!ini_get('safe_mode')) { 
      mail($recipient, $subject_encoded, $body, $from); 
   } else { 
      mail($recipient, $subject_encoded, $body, $from); 
   }
mdgroot
Posts: 155
Joined: Wed 11. Feb 2004, 17:47
Location: Netherlands

Post by mdgroot »

Any idea of what the problem was/is ?
User avatar
Oliver Georgi
Site Admin
Posts: 9949
Joined: Fri 3. Oct 2003, 22:22
Location: Dessau-Roßlau
Contact:

Post by Oliver Georgi »

Maybe additional headers are the problem or the "\n" has to be "\r\n" or "\n\r" on your system. Sometimes it is.

You can try this:

Code: Select all

if(isset($send_copy_to)) { 
      $from = "From: ".$send_copy_to."\r\n"; 
      if(!ini_get('safe_mode')) { 
         mail($send_copy_to, $subject_encoded, $body, "From: ".$recipient."\r\n".$content_type."\r\n"); 
      } else { 
         mail($send_copy_to, $subject_encoded, $body, "From: ".$recipient."\r\n".$content_type."\r\n"); 
      } 
   } else { 
      $from = "From: ".$recipient."\r\n"; 
   } 
   if(!ini_get('safe_mode')) { 
      mail($recipient, $subject_encoded, $body, $from.$content_type."\r\n"); 
   } else { 
      mail($recipient, $subject_encoded, $body, $from.$content_type."\r\n"); 
   }
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn
mdgroot
Posts: 155
Joined: Wed 11. Feb 2004, 17:47
Location: Netherlands

Post by mdgroot »

Oliver,

What is;
"-f".$from

doing ?
If I only remove (I'm still a little bit experimenting:-) ) this bit then the form is working.
User avatar
Oliver Georgi
Site Admin
Posts: 9949
Joined: Fri 3. Oct 2003, 22:22
Location: Dessau-Roßlau
Contact:

Post by Oliver Georgi »

additional attribut for sendmail
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn
jack
Posts: 2
Joined: Wed 17. Dec 2003, 22:25

Mail Problem

Post by jack »

For your information, this code sorted the problem for me.
Oliver Georgi wrote:Maybe additional headers are the problem or the "\n" has to be "\r\n" or "\n\r" on your system. Sometimes it is.

You can try this:

Code: Select all

if(isset($send_copy_to)) { 
      $from = "From: ".$send_copy_to."\r\n"; 
      if(!ini_get('safe_mode')) { 
         mail($send_copy_to, $subject_encoded, $body, "From: ".$recipient."\r\n".$content_type."\r\n"); 
      } else { 
         mail($send_copy_to, $subject_encoded, $body, "From: ".$recipient."\r\n".$content_type."\r\n"); 
      } 
   } else { 
      $from = "From: ".$recipient."\r\n"; 
   } 
   if(!ini_get('safe_mode')) { 
      mail($recipient, $subject_encoded, $body, $from.$content_type."\r\n"); 
   } else { 
      mail($recipient, $subject_encoded, $body, $from.$content_type."\r\n"); 
   }
User avatar
Oliver Georgi
Site Admin
Posts: 9949
Joined: Fri 3. Oct 2003, 22:22
Location: Dessau-Roßlau
Contact:

Post by Oliver Georgi »

Hi,

I have checked and worked out this one. I think this works best for everybody:

http://www.phpwcms.de/support/act_formmailer.zip

You will need the most current general.inc.php.

Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn
kngrnr
Posts: 5
Joined: Wed 16. Jun 2004, 20:32
Location: USA
Contact:

EMAIL FORM

Post by kngrnr »

I have checked and worked out this one. I think this works best for everybody:

http://www.phpwcms.de/support/act_formmailer.zip

You will need the most current general.inc.php.
i changed these files and the email form worked. but some areas of the backend stoped working properly, specifically the article features.
User avatar
DeXXus
Posts: 2168
Joined: Fri 28. Nov 2003, 06:20
Location: USA - Florida

Re: EMAIL FORM

Post by DeXXus »

kngrnr wrote:
I have checked and worked out this one. I think this works best for everybody:

http://www.phpwcms.de/support/act_formmailer.zip

You will need the most current general.inc.php.
i changed these files and the email form worked. but some areas of the backend stoped working properly, specifically the article features.
That thread is ~almost~ 4 month's old and phpWCMS has progressed beyond any use of that, I believe. :roll:
Post Reply