-
Problem with Gmail
Hi guys,
I hope that i'm in the right place. I have this problem. I use the below script on my website which sends email to my gmail account. It was working fine for a few days but somehow now it's not working. If i use another email, it works OK! Anyone has any ideas as to what is wrong?
script
<?php
@extract($_POST);
$name = stripslashes($name);
$email = stripslashes($email);
$country = stripslashes($country);
$subject = stripslashes($subject);
$comment = stripslashes($comment);
$company = stripslashes($company);
$asb = stripslashes($asb);
$address = stripslashes($address);
mail('mygmail@gmail.com',$subject,"A message from $name from($country) has been received as follows:
Comment: $comment
Company Name: $company
ASB Number: $asb
Address: $address
","From: $name <$email>");
header("location:thankyou.htm");
?>
-
-
I have no idea why that would not work. Does it fail to send the email or do you not receive the email at your gmail account?
Daniel -
Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
-
-
It used to send the emails before and i used to receive it. (though it was going into the spam folder but i created a filter to solve it). But now i don't get anything in my inbox. It can't be the sending problem coz when i type in another email (myemail@mydomain.com) it works fine. So i assume the problem is my gmail is not receiving any mails!
-
-
It's really hard to figure out what is wrong then.
Try this:
if (mail(....SAME AS ABOVE...)) { echo 'it works'; } else { 'it is broken'; }
To understand:
'it works': this means the server believes the mail was sent; it probably was; something is wrong with gmail getting the email
'it is broken': your server knows it didn't work; the submission was rejected and not sent
Beyond that, I suggest looking carefully in your gmail inbox/spam/etc.
Daniel -
Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
-
-
Hi Djr33,
Thank you very much for helping, but where do i put this code and what will it do?
-
-
You are just adding if (....)
around the mail() function. This means that you can find out what happened.
Every function has a "return" (result) value. This is what the function "equals".
So you can also do:
if (mail(....)==TRUE)
But the code above is just a shortcut.
In other words, you'll get TRUE for success and FALSE for failure.
(Note: many functions return other values, like text or numbers, but if nothing else they use TRUE and FALSE, and even if they are supposed to return text or numbers, it is common that they will return FALSE if something goes wrong.)
Daniel -
Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
-
-
Thanks a lot. i will try it and see
-
-
it works
Warning: Cannot modify header information - headers already sent by (output started at /home/webadmin/else.com/html/process.php:17) in /home/webadmin/else.com/html/process.php on line 18
this is what i get when i click submit button
script
<?php
@extract($_POST);
$name = stripslashes($name);
$email = stripslashes($email);
$country = stripslashes($country);
$subject = stripslashes($subject);
$comment = stripslashes($comment);
$company = stripslashes($company);
$asb = stripslashes($asb);
$address = stripslashes($address);
if ( mail('my.companysupport@gmail.com',$subject,"A message from $name from($country) has been received as follows:
Comment: $comment
Company Name: $company
ASB Number: $asb
Address: $address
","From: $name <$email>")){ echo 'it works'; } else { 'it is broken'; };
header("location:thankyou.htm");
?>
-
-
At the very top of the script put: and at the bottom put:
PHP Code:
ob_end_flush();
-
i get this error now
Parse error: parse error in /home/webadmin/else.com/html/process.php on line 19
Can you please give me the full script so that i can just copy and paste. Coz i maybe making some mistake
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks