Search…

X3 Photo Gallery Support Forums

Search…
 
shamhead
Topic Author
Posts: 7
Joined: 05 May 2009, 11:16

Email Problems

05 May 2009, 11:50

Hi all, first post here, I recently bought Imagevue and have been having great fun customising it for my new website, everything has been working well and its a great piece of software!

The only thing is my contact form doesn't seem to work, well, it says "sent" after using it, but the email never arrives. I have also uploaded the php test script which I found on the forum here created by one of the moderators, it gave me the all ok so I'm not sure what else to do.

I contacted my hosting provider fasthosts.co.uk who pointed me to their online support files for php mail which I've listed below (apologies for the huge post!) Is there anything in this which is different to the standard setup?

Please bear in mind I have no idea or understanding of coding!

Cheers.
 
shamhead
Topic Author
Posts: 7
Joined: 05 May 2009, 11:16

05 May 2009, 11:50

The fasthosts help text:


The sendmail script

Now we have a form that sends information to a script, we need to create a script to send the email. In this example, we will name the script sendmail.php as this is the address the our form is submitting the data to.

In order to send an email, we need certain information (variables), so lets set them first.

<?php
$email_to = "you@yourdomain.com";
$name = $_POST["name"];
$email_from = $_POST["email"];
$message = $_POST["message"];
$email_subject = "Feedback from website";
$headers =
"From: $email_from .\n";
"Reply-To: $email_from .\n";

The code above sets the email address you will send your email to and gets the users' name, email address, and message from the previous form. It also sets the variables that contain the email subject, and headers to specify the from and reply to email addresses.

Now lets build the message of the email with the users' name and comments.

$message = "Name: ". $name . "\r\nMessage: " . $message;

Finally, let's send the email. If the email is sent we will go to a thank you page, if there is an error we will display a brief message.

ini_set("sendmail_from", $email_from);
$sent = mail($email_to, $email_subject, $message, $headers, "-f" .$email_from);
if ($sent)
{
header("Location: http://www.yourdomain.com/thankyou.html");
} else {
echo "There has been an error sending your comments. Please try later.";
}
?>

This script does not have any validation or error checking, so it is not recommended that you copy it directly to your website, however, it does show the basics of sending email from our webservers, and can be used as a framework for your own scripts.

Using third party scripts to send email

Third party scripts using sendmail will also work on Fasthosts servers, although some will need slight changes made in order to work correctly.
If you are using a third party script to send email remember to set the sendmail_from variable (using ini_set('sendmail_from',email_from)), add the fifth -f parameter, and send the email either to, or from, a Fasthosts hosted email address.
 
shamhead
Topic Author
Posts: 7
Joined: 05 May 2009, 11:16

05 May 2009, 11:52

oh.. and the current website address is

www.shamhead.com/imagevuex2
 
User avatar
Nick
Imagevue Hitman
Posts: 2872
Joined: 02 May 2006, 09:13

05 May 2009, 12:44

Well obviously email function works but messages just not leaving your server or being killed somewhere on the way. Did you try with different emails? Are you sure you're not in some spam list or something?

The example script they sent you does exactly the same we do, sending mail using mail(). The problem is on their end (if you're not in spam db ofcourse, but even then I think some emails would still arrive somewhere)
firedev.com
 
shamhead
Topic Author
Posts: 7
Joined: 05 May 2009, 11:16

05 May 2009, 13:14

Thanks, I set up a googlemail account and the email came through fine. So its my mailbox not accepting it? It isn't being marked as spam on my other email address which is a "name"@shamhead.com type address, so its on the same host as the actual site.

Ill contact my website tech support now with this, but is there anything I can suggest that might be wrong? Like what you were saying about me being in a spam list? I take it you mean their server being in a spam list?

Thanks for your help
 
User avatar
mjau-mjau
X3 Wizard
Posts: 14452
Joined: 30 Sep 2006, 03:37

05 May 2009, 13:37

Is the email you are trying to send to on the same domain as the website? We had a user earlier who had a host who was blocking emails being sent to an email on the same domain as the mail sender application.
 
shamhead
Topic Author
Posts: 7
Joined: 05 May 2009, 11:16

05 May 2009, 13:53

Yea, the domain name is the same, maybe this is the problem, Ill mention it to the tech dudes and see what they have to say.

Cheers!