swift mailer Authenticate

Swift Mailer is a fantastic library for sending email with php. Discuss this library or ask any questions about it here.

Moderators: Chris Corbyn, General Moderators

Post Reply
nunchukz
Forum Newbie
Posts: 1
Joined: Tue May 20, 2008 8:31 am

swift mailer Authenticate

Post by nunchukz »

Code: Select all

 
        //SWIFT MAILER
        require_once "lib/Swift.php";
        require_once "lib/Swift/Connection/SMTP.php";
//      require_once "lib/Swift/Authenticator/LOGIN.php";
        
        $smtp = new Swift_Connection_SMTP("mail.sgp.com");
//      $smtp->setUsername("xxx");
//      $smtp->setpassword("xxx");
  
//      $smtp =& new Swift_Connection_SMTP("mail.sgp.com");
 
        $swift =& new Swift($smtp);
 
        $message =& new Swift_Message("You're invited to create a Portfolio");
        $message->attach(new Swift_Message_Part("You've successfully set up your account at sgp.com!", "text/html"));
 
        if( $swift->send($message, new Swift_Address($pic_username), new Swift_Address("administrator@sgp.com", "sgP")) )
        {
            $msg = '&msg=A verification mail was sent to your email address. Please follow the instructions to complete the sign up process. Thank you.';
        }
        else
        {
            die("We are unable to send you the mail for some technical problem");
        }
        $swift->disconnect();
 
pls help.
i couldnt even send out a basic mail.

i've tried the exact same coding with a free mail server and everything is working perfectly.
however, when i input my personal host mail server, it starts generating problem.
the username and password are correct, but not working in swift.
i dun understand.

please help
Post Reply