Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-12-2010, 01:37 AM   PM User | #1
dniwebdesign
Regular Coder

 
dniwebdesign's Avatar
 
Join Date: Dec 2003
Location: Carrot River, Saskatchewan
Posts: 838
Thanks: 15
Thanked 9 Times in 9 Posts
dniwebdesign is an unknown quantity at this point
mail() not working there but does here?

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).

PHP Code:
mail('dniwebdesign@sasktel.net','Test Message',"Hey You! this is just a test....","From: dnirvine@dniwebdesign.com\r\n"); 
__________________
Dawson Irvine
CEO - DNI Web Design
http://www.dniwebdesign.com

Last edited by dniwebdesign; 11-12-2010 at 05:45 PM..
dniwebdesign is offline   Reply With Quote
Old 11-12-2010, 04:10 AM   PM User | #2
poyzn
Regular Coder

 
poyzn's Avatar
 
Join Date: Nov 2010
Posts: 265
Thanks: 2
Thanked 61 Times in 61 Posts
poyzn is on a distinguished road
try this
PHP Code:
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.
poyzn is offline   Reply With Quote
Old 11-12-2010, 05:07 AM   PM User | #3
dniwebdesign
Regular Coder

 
dniwebdesign's Avatar
 
Join Date: Dec 2003
Location: Carrot River, Saskatchewan
Posts: 838
Thanks: 15
Thanked 9 Times in 9 Posts
dniwebdesign is an unknown quantity at this point
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.
__________________
Dawson Irvine
CEO - DNI Web Design
http://www.dniwebdesign.com
dniwebdesign is offline   Reply With Quote
Old 11-12-2010, 09:44 AM   PM User | #4
Jenny Dithe
Regular Coder

 
Join Date: Sep 2010
Posts: 457
Thanks: 212
Thanked 1 Time in 1 Post
Jenny Dithe is on a distinguished road
This works great for me, I thought I would pass it over in case it was any help.
PHP Code:
<?php

//connect to your server and db

    
require_once('lib\PHPMailer_V5.1\class.phpmailer.php');

    
$mail = new PHPMailer();
    
$mail->IsSMTP();
    
$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;
    }

?>
Jenny Dithe is offline   Reply With Quote
Old 11-12-2010, 05:46 PM   PM User | #5
dniwebdesign
Regular Coder

 
dniwebdesign's Avatar
 
Join Date: Dec 2003
Location: Carrot River, Saskatchewan
Posts: 838
Thanks: 15
Thanked 9 Times in 9 Posts
dniwebdesign is an unknown quantity at this point
It appears it was a hosting issue. :\ They seem to have fixed it now that they're back from the holiday.
__________________
Dawson Irvine
CEO - DNI Web Design
http://www.dniwebdesign.com
dniwebdesign is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:49 AM.


Advertisement
Log in to turn off these ads.