i need TOTAL HELP !!!

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
bug24
Forum Newbie
Posts: 1
Joined: Sat Jan 19, 2008 8:08 am

i need TOTAL HELP !!!

Post by bug24 »

I cant seem to understand what to do. i have uploaded swiftmailer to my domain... but what doi do to start sending emails?
what page do i visit?
help !!!!!!!!!!!!!!!!!
meti_alb
Forum Newbie
Posts: 12
Joined: Thu Jan 17, 2008 2:46 pm

Re: i need TOTAL HELP !!!

Post by meti_alb »

You have to read the documentation and you ll understand what you can do.
http://swiftmailer.org/wikidocs/

Anyways some simple code how you can use it.

Code: Select all

 
                
        //check with your host what your smtp server is (if using smtp)     
        $smtp =& new Swift_Connection_SMTP("smtp.myhost.com"); 
 
                        
        $smtp->setUsername("myusername");
        $smtp->setpassword("mypassword);
        $swift = new Swift($smtp);
                
        
        
                $message =& new Swift_Message("My subject", "My body");
        
        //recipients list
           $recipients = new Swift_RecipientList();
        
        
        
        $recipients->addTo("email1@somewhere.com]);
 
        $recipients->addTo("email2@somewhere.com]);  //and you can go on adding
        
        
    
        if ( $swift->batchSend($message, $recipients, "myadress@somewhere.com", "my name") ) 
        {
            $swift->disconnect();
            header("location: newsletter.php?msg=sentsuccess");
        }
        else 
        {
            $swift->disconnect();
            header("location: newsletter.php?msg=sentfail");
        }
Your message sounds like you were expecting something like phpmynewsletter script where you have an admin panel ... there is no such thing with swiftmailer....you have to build that.
bug24 wrote:I cant seem to understand what to do. i have uploaded swiftmailer to my domain... but what doi do to start sending emails?
what page do i visit?
help !!!!!!!!!!!!!!!!!
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: i need TOTAL HELP !!!

Post by Chris Corbyn »

Indeed, Swift is a library (i.e. "glue code") as opposed to an application. It makes it easy to build such an application, but doesn't tie you to any specific implementation.
Post Reply