Closed Thread
Results 1 to 4 of 4

Thread: mail() funtion

  1. #1
    1986mi35 is offline x10Hosting Member 1986mi35 is an unknown quantity at this point
    Join Date
    Jul 2011
    Posts
    6

    mail() funtion

    Hi there, I have switched host providers, because my previous provider, did not support imap function witch you guys do. But now I have dicovered that the mail() funciton in php is not working. I am using exatly the same code I was using on my previous host and there it was working alright. I tried to search you forum with no luck. Can you please, tell me if there is anything I need to set etc. I am going to be upgrading to a premium account providing all my code is working here, as far as I can tell right now everyhting apart from the mail() funtion is working. Thank you for your time

  2. #2
    Anna's Avatar
    Anna is offline I am just me Anna is a name known to allAnna is a name known to all
    Join Date
    Aug 2007
    Location
    Sweden
    Posts
    6,569

    Re: mail() funtion

    Free and premium does differ a bi in setup, with free hosting having some spam preventing limitations to mail functions. If I'm not misinformed it is required that a valid from address is used (in other words a from address that actually exist in your account).

    Mail() would normally be working, but I have heard from others on the same server as you are that there's something a bit messed up with it after the recent changes done.
    Do you have trouble reaching your site?
    Check here first: News and Announcements


    Don't forget that x10hosting has an irc server as well. Come and join the fun
    server: irc.x10hosting.com, main channel: #x10hosting
    There's a lot helpful users there if need help building your site

  3. #3
    1986mi35 is offline x10Hosting Member 1986mi35 is an unknown quantity at this point
    Join Date
    Jul 2011
    Posts
    6

    Re: mail() funtion

    Thank you for your respond Anna I do appreciate it,
    but unfortunetly it did not solve my problem, is there any more info you can give me ?
    Is there someone I should contact ... I have created an email account called admin. The code below was running just fine on my previous host. I realise that you probably dont look at the code and dont offer any advise on code, I am only sending it to demestrate that the code is valid.
    Thank you for you time.

    $to="example@googlemail.com";
    $from = "admin@biotechwihz.pcriot.com";
    $subject = "Transcript";
    $headers = "From: $from\r\n";
    $headers .= "Content-type: text/html\r\n";

    $message = '<html>
    <body>
    test
    </body>
    </html>';
    mail($to, $subject, $message, $headers);

  4. #4
    1986mi35 is offline x10Hosting Member 1986mi35 is an unknown quantity at this point
    Join Date
    Jul 2011
    Posts
    6

    Re: mail() funtion

    Right the mail function appears to be working now. Thank you for restoring this service.
    Here is the code that works, for anyone who might be intrested.

    Download php mailer from the link below
    http://code.google.com/a/apache-extr...downloads/list

    require("PHPMailer_5.2.0/class.phpmailer.php");
    $mail = new PHPMailer();

    $mail->From = "your_emaila_ccount@your_domain.com";
    $mail->FromName = "Admin";
    $mail->AddAddress("examle@example.com"); // This is the adress to witch the email has to be send.
    $mail->Subject = "An HTML Message";
    $mail->IsHTML(true); // This tell's the PhPMailer that the messages uses HTML.
    $mail->Body = "Hello, <b>my friend</b>! \n\n This message uses HTML !";
    $mail->AltBody = "Dear Sir/Madam \n\n This message uses HTML, but your email client did not support it !";

    if(!$mail->Send()) // Now we send the email and check if it was send or not.
    {
    echo 'Message was not sent.';
    echo 'Mailer error: ' . $mail->ErrorInfo;
    }
    else
    {
    echo 'Message has been sent.';
    }

Closed Thread

Similar Threads

  1. Replies: 0
    Last Post: 06-29-2011, 02:54 PM
  2. Mail funtion problem
    By shamildx85 in forum Free Hosting
    Replies: 5
    Last Post: 03-30-2011, 03:52 AM
  3. Replies: 1
    Last Post: 10-04-2010, 02:46 PM
  4. Replies: 1
    Last Post: 09-30-2009, 10:52 AM
  5. Replies: 3
    Last Post: 12-03-2007, 08:56 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers