PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Mon Mar 30, 2020 8:44 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Thu Mar 15, 2007 3:52 am 
Offline
Forum Newbie

Joined: Tue Mar 06, 2007 11:04 pm
Posts: 3
Syntax: [ Download ] [ Hide ]
require_once("lib/swift/Swift.php");

require_once("lib/swift/Swift/Connection/SMTP.php");

.....

$smtp = new Swift_Connection_SMTP('smtp.gmail.com',

                                  Swift_Connection_SMTP::PORT_SECURE,

                                  Swift_Connection_SMTP::ENC_TLS);

$smtp->setUsername($GMAIL_USERNAME);

$smtp->setPassword($GMAIL_PASSWORD);

$swift = new swift($smtp);

$message =& new Swift_Message("test1", "test2");

$message->setContentType("text/html");

$message->attach(new Swift_Message_Attachment(new Swift_File("one.out")));

$message->attach(new Swift_Message_Attachment(new Swift_File("two.out")));



$resultmail = $swift->send($message, $recipients, new Swift_Address($GMAIL_ADDRESS, "MONSTER"));

if (!$resultmail){

  echo "error: " .$resultmail;

 }

$swift->disconnect();


There are two problems in the e-mail that has been sent by the above code.
1-) Attachment files lose the first character of the filename...
So it is attached as "ne.out" and "wo.out"

2-) Body of the e-mail is lost. "test2" is nowhere to be found :)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 15, 2007 4:05 am 
Offline
Breakbeat Nuttzer
User avatar

Joined: Wed Mar 24, 2004 8:57 am
Posts: 13098
Location: Melbourne, Australia


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 15, 2007 6:36 pm 
Offline
Breakbeat Nuttzer
User avatar

Joined: Wed Mar 24, 2004 8:57 am
Posts: 13098
Location: Melbourne, Australia
Changes available in 3.0.6, just released.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group