Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder dniwebdesign's Avatar
    Join Date
    Dec 2003
    Location
    Carrot River, Saskatchewan
    Posts
    846
    Thanks
    15
    Thanked 10 Times in 10 Posts

    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"); 
    Last edited by dniwebdesign; 11-12-2010 at 05:45 PM.
    Dawson Irvine
    CEO - DNI Web Design
    http://www.dniwebdesign.com

  • #2
    Regular Coder poyzn's Avatar
    Join Date
    Nov 2010
    Posts
    266
    Thanks
    2
    Thanked 61 Times in 61 Posts
    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.

  • #3
    Regular Coder dniwebdesign's Avatar
    Join Date
    Dec 2003
    Location
    Carrot River, Saskatchewan
    Posts
    846
    Thanks
    15
    Thanked 10 Times in 10 Posts
    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

  • #4
    Regular Coder
    Join Date
    Sep 2010
    Posts
    460
    Thanks
    214
    Thanked 1 Time in 1 Post
    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;
        }

    ?>

  • #5
    Regular Coder dniwebdesign's Avatar
    Join Date
    Dec 2003
    Location
    Carrot River, Saskatchewan
    Posts
    846
    Thanks
    15
    Thanked 10 Times in 10 Posts
    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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •