View Full Version : Resolved mail() not working there but does here?

11-12-2010, 02:37 AM
So I was doing the usual user registration pages when I added the mail() to send out the authorization e-mail... but it didn't go. Need less to say I went down to the simplest format for mail() but it still doesn't send.

I tried this on another server/domain and it works (same hosting provider), so if someone can give me a few clues that would be great.

I have contacted support for the hosting company as well but since it's the 11th there's probably no one there (or very limited staff).

mail('dniwebdesign@sasktel.net','Test Message',"Hey You! this is just a test....","From: dnirvine@dniwebdesign.com\r\n");

11-12-2010, 05:10 AM
try this

mail('dniwebdesign@sasktel.net','Test Message',"Hey You! this is just a test....","From: dnirvine@dniwebdesign.com"."\r\n");

probably you have to add additional headers, ask you support for it.

11-12-2010, 06:07 AM
This doesn't do anything and doesn't really change the code.
I shouldn't need to add anything because on a different account, on the same hosting provider (BlackSun.ca)... it works.

Jenny Dithe
11-12-2010, 10:44 AM
This works great for me, I thought I would pass it over in case it was any help.


//connect to your server and db


$mail = new PHPMailer();
$mail->Host = 'mail.YOURDOMAIN.com';
$mail->Port = 25;
$mail->SMTPAuth = true;
$mail->Username = 'noreply@wherever.com';
$mail->Password = 'YOURPASSWORD';
$mail->From = 'noreply@whereever.com';
$mail->FromName = 'My Domain';
$mail->Subject = 'Test';
$mail->Body = "This a test

$mail->AddAddress(To@whoever.com, $Name);

if (!$mail->Send()) {
echo 'Message could not be sent at this time, please contact us to notify us of this error.<br /> Mailer Error: '. $mail->ErrorInfo;
} else if ($SentMessage){
echo $SentMessage;


11-12-2010, 06:46 PM
It appears it was a hosting issue. :\ They seem to have fixed it now that they're back from the holiday.