Author Topic: FastHosts - php mail() not working?? no confirm email sent  (Read 2501 times)

studio

  • Posts: 5
    • View Profile
FastHosts - php mail() not working?? no confirm email sent
« on: April 28, 2008, 09:15:14 am »
Hi - although it seems i have the SMTP all working ok, i don't get any confirmation messages sent. I notice that the confirmations use PHP Mail() to send and not SMTP.
My site is hosted with Fasthosts who have quite strict guidelines on this - i have to add a small bit of code to let the server know it is a geniune email and not spamming. Something like:

ini_set("sendmail_from", " user@yourdomain.com ");
mail( "yourname@yourdomain.com", "Feedback Form
results",$_POST['message'], "From: $_POST['email']", "-fuser@yourdomain.com" );
header( "Location: http://www.yourdomain.com/thankyou.html" );

do i have to add this somewhere and if so to which file?

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
FastHosts - php mail() not working?? no confirm email sent
« Reply #1 on: May 05, 2008, 04:38:55 pm »
I have a couple other clients experiencing problems with PHP mail on FastHosts, too.

The code you provided looks to be what may be necessary to fix the problem.  Where did you learn of this code?  Is there a knowledgebase article stating it?
Code: [Select]
ini_set("sendmail_from", " user@yourdomain.com ");
This line could be added anywhere in config.php.  The email address should be set to your ListMail "Bounce to email" from the Configuration page.
Code: [Select]
mail( "yourname@yourdomain.com", "Feedback Form
results",$_POST['message'], "From: $_POST['email']", "-fuser@yourdomain.com" );

It is not advisable to modify the ListMail code that calls the PHP mail() function.  However, you -can- utilize the 5th parameter to PHP mail with a change in ListMail's config.php as follows:
Code: [Select]
$phpmailf = 1;
This ensures the 5th parameter is used and set to the ListMail "Bounce to email".

I am not sure if the first modification is needed when the second option is enabled - I believe they essentially do the same thing.

Regards
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting

studio

  • Posts: 5
    • View Profile
FastHosts - php mail() not working?? no confirm email sent
« Reply #2 on: May 07, 2008, 08:30:00 am »
thank you - this seems to have fixed the problem and we are now getting the confirmation and welcome emails.  I actually applied both the code:

Code: [Select]
ini_set("sendmail_from", " bounce@yourdomain.com ");

and the change to the php mail 5th parameter as well and it worked.