email problem again

This is a discussion on "email problem again" within the PHP Forum section. This forum, and the thread "email problem again are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Jul 15th, 2006, 09:29
Junior Member
Join Date: Jul 2006
Location: spain
Age: 20
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
email problem again

Right i got the basic mail() function to work but i need a if statement. So i did the following code.

<?php
$Firdge = $_POST['ChkFridge'];
$Pool = $_POST['ChkPool'];

if (mail('EMAIL ADDRESS','Form feedback','Message here', 'From: email.com')){
print("<p>Thank you for your enquiry, please go back</p>");
}else{
print("<p>An unknown error has occured, please go back</p>");
}
?>

It seems to work i dont get any errors and the thank you is printed on the screen, i check my inbox but no mail is being sent.
Reply With Quote

  #2 (permalink)  
Old Jul 15th, 2006, 10:05
Up'n'Coming Member
Join Date: Feb 2006
Location: London
Age: 25
Posts: 98
Thanks: 0
Thanked 0 Times in 0 Posts
Re: email problem again

Your if statement is checking to see if the mail function is true, it's not performing the mail function.

You want to say, if 'somethings true', then send the email and print 'thankyou for your enquiry' - else, print 'an unknown error has occured'...


if (somethings true) {
mail('EMAIL ADDRESS','Form feedback','Message here', 'From: email.com');
print("<p>Thank you for your enquiry, please go back</p>");
}else{
print("<p>An unknown error has occured, please go back</p>");
}

Just post again if you have more questions

Cheers,
Jim.
Reply With Quote
  #3 (permalink)  
Old Jul 15th, 2006, 11:18
Junior Member
Join Date: Jul 2006
Location: spain
Age: 20
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Re: email problem again

thank you for the info, so simple lol
Reply With Quote
  #4 (permalink)  
Old Jul 15th, 2006, 20:44
Most Reputable Member
Join Date: Apr 2006
Location: Cornwall, UK
Posts: 1,310
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Skype™ to ukgeoff
Re: email problem again

mail() is a boolean function and therefore returns true or false as appropriate.

It is more likely, looking at your code, that your email is being filtered out as spam because your From: email address is not a valid format.
Reply With Quote
Reply

Tags
email, problem, again

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
problem of valiadation of email begeiste PHP Forum 5 Oct 11th, 2007 17:40
Problem sending Multiple Attachments w/Email wacara Classic ASP 0 Aug 9th, 2007 19:50
Dreamweaver Email ATT File Problem Flyaheli PHP Forum 7 Aug 4th, 2007 06:47
HTML Email Problem!?!?!? uqwebdesign Web Page Design 12 Feb 22nd, 2007 07:12
asp.net send email problem sunnyko ASP.NET Forum 5 Sep 12th, 2006 10:31


All times are GMT. The time now is 08:12.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43