Page 1 of 1

Sending out eMail

Posted: Mon Sep 07, 2009 5:40 am
by SunnyOz
Script URL: www.artbykids.com.au/gbook/gbook.php
Version of script: 1.7
What terms did you try when SEARCHING for a solution: email, sending email, admin email

Write your message below:

I really love this guestbook.. thanks for providing it!

I have installed it for a client that has their website hosted Windows server running IIS. Even though I usually use .asp for script coding for this client, I checked with the hosting company, and it appears they support .php also.

So I installed, and it works like a charm!.. with one exception.

I don't seem to be able to send out the eMails to the 'admin_email' or to the guest when their entry is replied to. (I don't get errors, just never receive any eMails)

I am thinking this might be due to the fact that their hosting company uses CDO to send out eMails from the server scripts.

What process does gbook use? And where can I find it in the code.

Any suggestions on what could be wrong?? :?:

Posted: Mon Sep 07, 2009 4:38 pm
by Klemen
GBook uses the standard PHP mail() function to send mail (search for mail( in the code) - your host is the one that needs to configure PHP to send e-mail properly, it's not done from the script.

Posted: Tue Sep 08, 2009 12:06 am
by SunnyOz
thanks for your quick reply.

I need to write to the server support people to ask them if they can support this. I want to send them an example mail() statement that you might send out from the guestbook.

Is the below correctly formatted? I substituted the parameters - as examples - for the reply to the guestbook signer. (It appears to me that the double quotes are not correct when I replaced the $fields). Please let me know if this is a valid syntax: (I have replaced the valid eMail addresses with fake ones to post here only)

Code: Select all

mail(abc@def.com.au,Reply to your Guestbook entry,The owner of xyz has just replied to your entry.,"From: xyz@xyz.com.au\nReply-to: xyz@xyz.com.au\nReturn-path: xyz@xyz.com.au\nContent-type: text/plain; charset=".windows-1250);

Posted: Tue Sep 08, 2009 5:53 am
by Klemen
The code in GBook is the correct one, it works on hundreds of servers. You can't just replace $email with asdasd@asdasd.com without using quotes, PHP does that correctly (it knows $email is a string).

Posted: Tue Sep 08, 2009 7:20 am
by SunnyOz
OK, I see what you are saying. However, that doesn't really end up helping me as I need to give the server people an example of what a mail statement will look like when it is received by the server.

You say it is the standard format, and I believe you, but THEY won't believe ME, so I need to show an example of what is sent, and then MAYBE they will go look at their side of things.

I will be eMailing them with my problem. I have found them to be the worst tech support group, and know they won't really help unless I provide info just as they request.

If I try to email them this line of code as an example of a standard PHP mail() function to send mail:

Code: Select all

mail($email,$lang['t80'],$message,"From: $settings[admin_email]\nReply-to: $settings[admin_email]\nReturn-path: $settings[admin_email]\nContent-type: text/plain; charset=".$lang['enc']);
they will just say they don't know what actual values are getting sent - or that it isn't proper syntax, etc.

So instead of me trying to substitute real values into the strings (as I did previously, and did incorrectly because I didn't know the placement of quotes that will happen automatically), can you do it for me using this same line of code from gbook.php?

Code: Select all

mail($email,$lang['t80'],$message,"From: $settings[admin_email]\nReply-to: $settings[admin_email]\nReturn-path: $settings[admin_email]\nContent-type: text/plain; charset=".$lang['enc']);
You can just make up eMail values and subject values, etc, as long as it ends up looking the same as far as syntax structure goes as the real one would when done from within gbook.php code.

Here is my attempt at doing it correctly... if it is correct, can you say so.. and if not, can you provide the correct resulting version for me?

Code: Select all

mail("abc@abc.com.au","Reply to your Guestbook entry","The owner of xyz has just replied to your entry.","From: xyz@xyz.com.au\nReply-to: xyz@xyz.com.au\nReturn-path: xyz@xyz.com.au\nContent-type: text/plain; charset=windows-1250");
I actually think they won't support the .php mailer, as they offer other means to send out eMail from the window server (like CDONT with .asp code), but I wanted to at least try to see if they will work with me on this.

Posted: Tue Sep 08, 2009 2:18 pm
by Klemen
That's the correct one, well done.

You need to understand that I don't provide general PHP support (just limited support for my free scripts), hence I'm reluctant to give exhaustive answers about topics related to the PHP code in general.


A bit out of the topic: if I'd be paying for hosting and host said they support PHP but tell me to use ASP if I want to send out mail I would look elsewhere. If I pay for PHP support they don't have the right to dictate me to use ASP instead. Just my two cents...

Posted: Wed Sep 09, 2009 3:49 pm
by Tame
I am having same issue. I just upgraded from 1.6 to 1.7. In 1.6 it was working fine and now it doesn't.

Posted: Thu Sep 10, 2009 5:24 am
by Henrie
@Tame
Tame wrote:I am having same issue. I just upgraded from 1.6 to 1.7. In 1.6 it was working fine and now it doesn't.
Please start a new topic and give the info asked in this topic viewtopic.php?t=83
Script URL:
Version of script:
Hosting company:
URL of phpinfo.php:
URL of session_test.php:
What terms did you try when SEARCHING for a solution:

Write your message below:
That way it is easier for us to help you.
Now we just don't know what causes the malfunction in your specific case.

Greetings,
Henrie