ACCUWEBHOSTING.COM
Live Chat
Sales / Billing / Support
Support
FAQ, Help Desk
Affiliate
Earn $20.00 / Sale
+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Shane is offline Administrator Shane has disabled reputation
    Join Date
    Jun 2006
    Age
    27
    Posts
    266
    Blog Entries
    9
    Rep Power
    10

    Default How to send email via PHPMailer – Linux server



    Hello All,

    In order to send email from Linux server from PHPMailer then one can use below mentioned sample script:


    <?php
    require("class.phpmailer.php");
    $mail = new PHPMailer();

    $mail->IsSMTP(); // send via SMTP
    $mail->Host = "mail.yourdomainname"; // SMTP servers
    $mail->SMTPAuth = true; // turn on SMTP authentication
    $mail->Username = "SMTP Email Username"; // SMTP username
    $mail->Password = "SMTP Email password"; // SMTP password

    $mail->From = "From Email address";
    $mail->FromName = "Name to Display";
    $mail->AddAddress("Recipient Email address ","Recipient Name");
    $mail->AddCC(“CC Email Address”);
    $mail->AddBCC(“BCC Email address”);
    $mail->AddReplyTo("Reply to email address");

    $mail->WordWrap = 50; // set word wrap

    $mail->IsHTML(true); // send as HTML

    $mail->Subject = "Subject";
    $mail->Body = "body";

    if(!$mail->Send())
    {
    echo "Message did not sent <p>";
    echo "Mailer Error: " . $mail->ErrorInfo;
    exit;
    }

    echo "Message has been sent";
    ?>

    Thanks,

    Shane G.
    AccuWebHosting.Com
    Last edited by Shane; 03-28-2009 at 02:26 AM.

  2. #2
    ryan is offline Member ryan is on a distinguished road
    Join Date
    Jun 2008
    Age
    21
    Posts
    98
    Blog Entries
    29
    Rep Power
    27

    Default Re: How to send email via PHPMailer – Linux server



    Hello Shane,

    Hey, that was really a great script.. I was searching for a long while. Thank you very much man.. But one thing, when I add the CC and BCC fields, it gives me the error. Hence I need to remove those fields. can you help it out?????
    Best regards,

    Ryan S.

    Best Wordpress Themes

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
© Copyright 2010 - 2020 AccuWebHosting.Com. All rights reserved. AccuWebHosting.com,
48 Bi-State Plaza #185 Old Tappan, NJ 07675, United States of America

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45