WordPress.org

Ready to get started?Download WordPress

Forums

dlb's Send-A-Link
smtp auth limitation (1 post)

  1. maxpontello
    Member
    Posted 7 months ago #

    Hello Dave,

    first of all I think your plug-in is very useful and well designed, so I would like to thank you for this work.

    Unfortunately, my site must relay on an external smtp server wich requires smtp auth, so the mail() function doesn't work for me.

    So I put PHPMailer in the plugin directory and changed dsl.php as follows:

    //send the email
    include_once('PHPMailer/class.phpmailer.php');
    $mymail             = new PHPMailer();
    $body             = $dslData['mail-message-body'];
    $body             = eregi_replace("[\]",'',$body);
    
    $mymail->IsSMTP(); // telling the class to use SMTP
    $mymail->Host       = $mysmtpserver; // SMTP server
    
    $mymail->SMTPAuth = true;                  // enable SMTP authentication
    $mymail->Host = $mysmtpserver; // SMTP server
    $mymail->Username = $mysmtpuser;
    $mymail->Password = $mysmtppassword;
    //$mymail->Port = 465; // optional if you don't want to use the default
    
    $mymail->From       = $dslData['dsl_saddress'];
    $mymail->FromName   = $dslData['dsl_sname'];
    
    $mymail->Subject    = $dslData['mail-subject'];
    
    $mymail->AltBody    = $dslData['mail-message']; // optional, comment out and test
    
    $mymail->MsgHTML($body);
    
    $mymail->AddAddress($dslData['mail-to'], $dslData['rname']);
    
    //$mymail->AddAttachment("images/phpmailer.gif");                        
    
    if(!$mymail->Send()) {
                    $dslData['mail-result'] = false;
            } else {
                    $dslData['mail-result'] = true;
    }

    Now it works properly, so I suggest you to add to the roadmap these smtp extended features and to implement options and credentials setup on the admin panel side.

    Thx for your attention,
    Best Regards
    -max

    http://wordpress.org/plugins/dlbs-send-a-link/

Reply

You must log in to post.

About this Plugin

About this Topic

Tags