PHP / smtp? Smartermail (don't receive any email)

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
weiktoh
Forum Newbie
Posts: 2
Joined: Mon Apr 20, 2015 10:47 am

PHP / smtp? Smartermail (don't receive any email)

Post by weiktoh »

I created a HTML/PHP on my online contact form.
after insert all information ,and return to the index.html
i still don't receive any email from the website .

how can i fix this ?
sorry, I'm working on improving my english.

Code: Select all

<?php
if(isset($_POST['submit']))  {
   $msg = 'Company: '.$_POST['company']."\n"
   .'Address: '.$_POST['address']."\n"
   .'Website: '.$_POST['website']."\n"
   .'Your Contact: '.$_POST['contact']."\n"
   .'Email : '.$_POST['email']."\n"
   .'Remark : '.$_POST['remark']."\n";
   mail('sale@jadepack.com.sg', 'Online Enquiry', $msg);
   header('location: index.html');
} else {
   header('location: onlineenquiry.html');
   exit(0);
}


?>
Image

http://www.jadepack.com.sg/onlineenquiry.html
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: PHP / smtp? Smartermail (don't receive any email)

Post by Celauran »

Try capturing the result of the mail call and inspecting that rather than redirecting. Additionally, check your mail log. It's possible the email is being sent and not received, and it's possible that it's not being sent all. Knowing which is the case is the first step in troubleshooting this.
weiktoh
Forum Newbie
Posts: 2
Joined: Mon Apr 20, 2015 10:47 am

Re: PHP / smtp? Smartermail (don't receive any email)

Post by weiktoh »

how can I check for the possible case?
mail log ,is it from my smtp? or using 3rd party software
Sorry, i don't have any knowledge on this
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: PHP / smtp? Smartermail (don't receive any email)

Post by Celauran »

It's your mail server's log. Usually found in /var/log
Post Reply