Jump to content

Webhosting mail server problem?


monicao

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/195825-webhosting-mail-server-problem/
Share on other sites

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.