"Mail" function not working in new server

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
arnabs
Forum Newbie
Posts: 2
Joined: Tue Jul 25, 2006 4:12 am

"Mail" function not working in new server

Post 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]
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post 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'); ?>
FE
Forum Commoner
Posts: 35
Joined: Fri Jul 14, 2006 5:21 am

Post by FE »

can you tell us what OS and PHP version you are using?
Post Reply