monicao Posted March 19, 2010 Share Posted March 19, 2010 Hello! I have an e-shop: after one user sent a purchase order from my site, I have to receive an e-mail from server with that purchase order. The problem is that I don't receive all the purchase orders sent by all users! I don't know if it is my fault or my webhosting mail server is not properly set. You can see below my PHP code for sending the purchase order to me: $headers="MIME-version:1.0\r\nContent-type: text/html; charset=iso-8859-2\r\n"; mail("$myemail","$subject","$message","From: $name <$mail>\nContent-type:text/html"); Is my email code wrong? Or I have to change my webhost? I need an advice, thankyou, Monica Quote Link to comment https://forums.phpfreaks.com/topic/195825-webhosting-mail-server-problem/ Share on other sites More sharing options...
oni-kun Posted March 19, 2010 Share Posted March 19, 2010 Why is this in the comments/suggestions section? Try setting it into a variable: $headers="MIME-version:1.0\r\nContent-type: text/html; charset=iso-8859-2\r\n"; $sent = mail("$myemail","$subject","$message","From: $name <$mail>\nContent-type:text/html"); if (!$sent) { exit('E-mail could not send, there was an error. Please try again.'); } But you also don't use the '$headers' variable, you should plug it in if you're wanting to add those specific headers. Quote Link to comment https://forums.phpfreaks.com/topic/195825-webhosting-mail-server-problem/#findComment-1028676 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.