Page 1 of 1
i need TOTAL HELP !!!
Posted: Sat Jan 19, 2008 9:16 am
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 !!!!!!!!!!!!!!!!!
Re: i need TOTAL HELP !!!
Posted: Sat Jan 19, 2008 12:53 pm
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 !!!!!!!!!!!!!!!!!
Re: i need TOTAL HELP !!!
Posted: Sat Jan 19, 2008 5:23 pm
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.