Jump to content

php mail() ... dont work with my new server


anthelo

Recommended Posts

Hello,

 

im using a contact form which sends me an email with the data name.. comments ..

 

Now im testing a new better server which use IMAP (old POP3) and my form is not working like it used to be..

 

                $emailTo = " $dbSentEmail"; //Put your own email address here
	$emailServer = "[email protected]"; //Put your own email address here
	$body = "Name: $name \n\nEmail: $email \n\nSubject: $subject \n\nComments:\n $comments";
	$headers  = 'MIME-Version: 1.0' . "\r\n";
	$headers .= 'Content-type: text/plain; charset=UTF-8' . "\r\n";
	$headers .= 'From: Contact Form <'.$emailServer.'>' . "\r\n" . 'Reply-To: ' . $email;

	mail($emailTo, $subject, $body, $headers);

 

Any idea what i have to do to work like before?

 

Link to comment
https://forums.phpfreaks.com/topic/231575-php-mail-dont-work-with-my-new-server/
Share on other sites

IMAP is just for retrieving the email, just like POP3. If its a send issue, you can blame the MTA (otherwise known as SMTP).

In that case, you have to raise a support ticket

 

Add on top of your script to see error, which are trigger by mail()

error_reporting(E_ALL);
ini_set('display_errors', 1);

@thorpe

Let me explain..

 

Im running the same script on 2 differents hosting servers, on my new server for some reasons im using imap.domain.com on my old just the domain.com for incoming and outgoing..

 

The same script is running live on both servers  (old/new) ... my old server is working perfect on the new one is not sending the email like its supposed to be.

 

Thats why im looking if there is any differences using pop3/imap and mail() function

 

@MrXHellboy

 

Thanks ill try that

 

 

Thank you guys

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.