Host blocking PHP mail notifications

Dr. GBooky is here to help you with your guestbook problems ...
Post Reply
etchet
Posts: 1
Joined: Mon Mar 07, 2011 7:13 pm

Host blocking PHP mail notifications

Post by etchet »

Script URL:
Version of script: 1.7
Hosting company: fasthosts.co.uk
URL of phpinfo.php: http://www.flutterbydaisy.co.uk/guestbook/phpinfo.php
URL of session_test.php: http://www.flutterbydaisy.co.uk/guestbo ... n_test.php
What terms did you try when SEARCHING for a solution:

Write your message below:

Hi guys,

I am extremely new to php, and the guestbook code and instructions you have built have been incredibly helpful for me. I have got everything to function as required, learning as I go along but I am yet to get the email notifications to function.

I didn't know why until I discovered that the host company I am using have some procedures in place with php and mail scripts. They require that I use an email address that is registered to the URL name. So I set up a ******************* email address. This wasn't enough to get the code to work though, and after doing some reading I have found that I need to incorporate the following code:

<?php
ini_set("sendmail_from", "user@yourdomain.com");
mail($email_to, $email_subject, $email_message, $headers, "-fuser@yourdomain.com");
?>

I am very google hungry, and infact most of the entire website im building has been done by me finding and adapting code. However I am not sure how to add the above into your existing guestbook code.

If someone could just point me in the right direction I would be incredibly grateful.
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Re: Host blocking PHP mail notifications

Post by Klemen »

Open gbook.php in notepad and find all lines that start with

Code: Select all

mail(
Each of these lines ends with

Code: Select all

);
Add this before the "ends with" code:

Code: Select all

, "-fuser@yourdomain.com"
(that is -f plus user@yourdomain.com)

Then open settings.php in Notepad and just below

Code: Select all

ini_set('log_errors', 1);
add

Code: Select all

ini_set("sendmail_from", "user@yourdomain.com");
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Post Reply