Problems with email sending via PHP...

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Mr Tech
Forum Contributor
Posts: 424
Joined: Tue Aug 10, 2004 3:08 am

Problems with email sending via PHP...

Post by Mr Tech »

Hey there,

I've set up a contact form on my clients website. The contact form is submitted to a PHP page containing this:

Code: Select all

<?php
$your_subject = "Message from your website's contact form";
$your_email = "info@seapen.net.au";
$inside_mail = "First Name: $fname
Last Name: $lname
Email Address: $email
Address: $address
Phone Number: $phone
Comments: $comments
";
 
@mail($your_email, $your_subject, $inside_mail, "From: \"$fname\"<$email>\r\nReply-To:  $email\r\nX-Sender:$fname using $email\r\nReturn-Path: $email");
 
header("location: ../contact_thanks.php");
?>

When I submit the form, the email does not go through into their inbox. I think their server is blocking it... I tested sending it to two of my email addresses and it worked just fine.

Any ideas as to why this is not working? Is theer a better script I could use to stop it from being blocked?

Thanks

Ben
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

Post by shiznatix »

maybe its being put in their junk mail folder, you gotta tweak your headers to make it accesable for diffrent accounts like hotmail and yahoo and whatnot
User avatar
Mr Tech
Forum Contributor
Posts: 424
Joined: Tue Aug 10, 2004 3:08 am

Post by Mr Tech »

I don't think they have a Junk folder... it's being received in Outlook Express.
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

The only thing you can do is ask their sysadmin to allow e-mails coming from you.. But i don't think she will do that...
Syranide
Forum Contributor
Posts: 281
Joined: Fri May 20, 2005 3:16 pm
Location: Sweden

Post by Syranide »

Note: mails coming from a SMTP server on a dynamic IP range are very commonly blocked by major mailservices as these are commonly spam, if you are using such that could be the problem, try using your assigned one if you have one or find a free one on the net. (if so)
Post Reply