help adde my caode to batch send

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
zamaliphe
Forum Newbie
Posts: 3
Joined: Thu Apr 24, 2008 10:09 am

help adde my caode to batch send

Post by zamaliphe »

i have install the swift mailer script just fine
and here is my test link
http://www.freehost99.com/home/mail/swi ... ts/smokes/
work great
Message sent successfully

but i need to make batch send code for list of my emails

here is how i get the list of sender emails

Code: Select all

 
<?php
//file mail.php
$letter = file_get_contents('letter');
$users = file("aremail.txt");
foreach ($users as $user)
{
    echo "$user\n";
    echo "<br>";
}
 
?>
 
and the file link is http://www.freehost99.com/home/mail/swi ... s/mail.php

now how can i added the recipients list using this simple loob

and i need working code for batch send that i can use

like the runTestOfBasicSend.php code

acode that can send emails

i have trayed to creat my code but i dot know what i miss

so i stuck and i need help pleases

this is the code i have been work so far

http://pastebin.com/d5bb319f3

hop you can help me fix it

or even replace it all

thanks alott
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: help adde my caode to batch send

Post by Chris Corbyn »

Please read the documentation. It looks like what you posted is the code from my smoke tests. There are some basic tutorials in the wiki. Those smoke tests are probably a little advanced and not very representative of how to use Swift in the real world.

http://swiftmailer.org/wikidocs/v3/tutorials/basic
http://swiftmailer.org/wikidocs/v3/tutorials/batch
zamaliphe
Forum Newbie
Posts: 3
Joined: Thu Apr 24, 2008 10:09 am

Re: help adde my caode to batch send

Post by zamaliphe »

Chris Corbyn wrote:Please read the documentation. It looks like what you posted is the code from my smoke tests.
the code in the documentation dont work but the code in the example work berfckt
why ???
what do that code need in order to send mails ??
that is why i trayed to use the code form the example
and also the documentation dont cover allot of things
that is why i'm here :D

i need simple working code i can start with

can you help me with that

also how can i know if i did some thing wrong ?
Chris Corbyn wrote: There are some basic tutorials in the wiki. Those smoke tests are probably a little advanced and not very representative of how to use Swift in the real world.

http://swiftmailer.org/wikidocs/v3/tutorials/basic
http://swiftmailer.org/wikidocs/v3/tutorials/batch
i have copy the code and edit it and uploud it to my web site and i get only plank screen

whay ??

here is how the cod looks like

Code: Select all

 
 
<?php 
//Load in the files we'll need
require_once "lib/Swift.php";
require_once "lib/Swift/Connection/SMTP.php";
 
//Start Swift
$swift =& new Swift(new Swift_Connection_SMTP("smtp.gmail.com"));
 
//Create the message
$message =& new Swift_Message("just subject", "just body for my emails");
 
//Now check if Swift actually sends it
if ($swift->send($message, "zamaliphe@gmail.com", "zamaliphe@gmail.com")) echo "Sent";
else echo "Failed";
?>
 
 
thanks for your answer
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: help adde my caode to batch send

Post by Chris Corbyn »

A blank screen indicates a fatal error. There are things in that code you can't just copy & paste. For example, the require_once() calls will need changing so they are using the correct path to Swift.

EDIT | I must stress, the smoke tests are not an "example". They are only there to make sure it works.
zamaliphe
Forum Newbie
Posts: 3
Joined: Thu Apr 24, 2008 10:09 am

Re: help adde my caode to batch send

Post by zamaliphe »

Chris Corbyn wrote:A blank screen indicates a fatal error. There are things in that code you can't just copy & paste. For example, the require_once() calls will need changing so they are using the correct path to Swift.

EDIT | I must stress, the smoke tests are not an "example". They are only there to make sure it works.
i did now check the require_once() function
but i'm still geting plank screen
do you hav any idea what is wrong
or what that code need to be able to work
like i sayed i need simple working code to start with
can you chat with me ?
here is the link to the file on the server

and i have edit the code

and this is the new one

pleases advice me with the right code :)

http://www.freehost99.com/home/mail/swi ... tbatch.php

Code: Select all

 
<?php
 
//Load in the files we'll need
require_once "/home/mail/swift5/lib/Swift.php";
require_once "/home/mail/swift5/lib/Swift/Connection/SMTP.php"; 
//Start Swift
$swift =& new Swift(new Swift_Connection_SMTP("smtp.gmail.com"));
//Create the message
$message =& new Swift_Message("just subject", "just body for my emails");
//Now check if Swift actually sends it
 
$stream =& $message->build();
echo $stream->readFull();
 
if ($swift->send($message, "zamaliphe@gmail.com", "zamaliphe@gmail.com")) echo "Sent";
else echo "Failed";
?>
 
 
ok after i added thos tow line to view the masseg that is about to sent
i get this

Code: Select all

 
To: 
From: 
Subject: just subject
Date: Thu, 24 Apr 2008 21:36:19 -0400
X-LibVersion: 3.3.2
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
 
just body for my emails
 
hmm where is the to and from fild ? and why thay are empty
and thanks agin for your grate script and for your fast answer :D
Post Reply