*This documentation covers the items below
(creating an SMTP transport, then using it to send email)*
http://swiftmailer.org/docs/sending.html

*Instead of just sending you back to the docs, here's an example of a
working swiftmailer method/function with SMTP: **(i.e. you can just modify
this to suit your needs)*

    //get swiftmailer library
    require_once '/swiftmailer/lib/swift_required.php';
    // Create the Transport
    $transport = Swift_SmtpTransport::newInstance('xyz.com', 465, 'ssl')
            ->setUsername('admin+somesite.com')
            ->setPassword('yourPassword');

    // Create the Mailer using your created Transport
    $mailer = Swift_Mailer::newInstance($transport);
    // Create a message
    $message = Swift_Message::newInstance('subject')
            ->setFrom(array('[email protected]' => 'Some Name'))
            ->setTo(array($data['email'] => $data['first_name'] . " " .
$data['last_name']))
            ->setBcc(array('[email protected]' => 'Some Name'))
            ->setSubject($data['subject'])
            ->setBody($data['message'], 'text/html')
            ->setReplyTo(array('[email protected]' => 'Some Name'));

    // Send the message
    $result = $mailer->send($message);

-Jason

On Thu, May 24, 2012 at 5:18 PM, Steve Meyers <[email protected]>wrote:

> On 5/24/12 4:59 PM, [email protected] wrote:
>
>> Generally speaking, I think most developers use swiftmailer these days.
>> It's what I normally use to send email... (if I'm not inside of a
>> framework using a helper method)
>> http://swiftmailer.org/
>> It allows you to use SMTP of course...
>>
>
> I looked at that, but it doesn't seem to support what I need.  I have the
> message (including headers) all ready to go, and just need to send it out
> using an SMTP connection.  I don't see a way for SwiftMailer to do that
> (from a cursory read of the docs).  Otherwise, it looks like a great
> library.
>
> Steve
>

_______________________________________________

UPHPU mailing list
[email protected]
http://uphpu.org/mailman/listinfo/uphpu
IRC: #uphpu on irc.freenode.net

Reply via email to