Page 1 of 1

"Mail" function not working in new server

Posted: Tue Jul 25, 2006 4:14 am
by arnabs
Pimptastic | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


Auto-send out email script in PHP in my new server does not seem work;
so no auto-mails are sent out and no error messages are produced.
But in my old server I have the same codes and it works!

Any settings I require to do in PHP or at the server?
Below I paste the codes

Code: Select all

<?
$recipient = "test <test@test.com>";
$subject = "Test";
 
$message ="TEST";
 
$headers .= "From: ABC <ABC@test.com>\n";
$headers .= "X-Sender: <ABC@test.com>\n";
$headers .= "X-Mailer: test.com\n"; // mailer
$headers .= "X-Priority: 1\n"; // Urgent message!
$headers .= "Return-Path: <ABC@test.com>\n";  // Return path for errors
 
$headers .= "Content-Type: text/html; charset=iso-8859-1\n"; // Mime type
 
mail($recipient, $subject, $message, $headers);
?>

Pimptastic | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Posted: Tue Jul 25, 2006 4:52 am
by Chris Corbyn
Iy could be that your new host is blacklisted, or it could be that php.ini is net configured correctly. Turn full error reporting on :)

Code: Select all

<?php error_reporting(E_ALL); ini_set('display_errors', 'On'); ?>

Posted: Tue Jul 25, 2006 11:12 am
by FE
can you tell us what OS and PHP version you are using?