PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Sat Nov 22, 2014 7:47 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: PHP4
PostPosted: Mon Feb 28, 2011 1:59 pm 
Offline
Forum Newbie

Joined: Mon Feb 28, 2011 1:51 pm
Posts: 6
Hello!
My website is written in PHP4.

I noticed that the examples seem to be for PHP5.

Are there any examples around showing how to create and send messages using the PHP4 version of Swift Mailer?

Thank you in advance.


Top
 Profile  
 
 Post subject: Re: PHP4
PostPosted: Mon Feb 28, 2011 2:27 pm 
Offline
Site Admin
User avatar

Joined: Tue Dec 23, 2003 3:10 am
Posts: 11470
Location: Toronto
As far as I know, Swiftmailer requires PHP5.


Top
 Profile  
 
 Post subject: Re: PHP4
PostPosted: Mon Feb 28, 2011 2:53 pm 
Offline
Forum Newbie

Joined: Mon Feb 28, 2011 1:51 pm
Posts: 6
Yes, the current version requires PHP5. In the download area, there are various versions that support PHP4.


Top
 Profile  
 
 Post subject: Re: PHP4
PostPosted: Mon Feb 28, 2011 2:59 pm 
Offline
Moderator
User avatar

Joined: Mon Nov 03, 2003 7:13 pm
Posts: 5919
Location: Odessa, Ukraine
azthoa wrote:
Yes, the current version requires PHP5. In the download area, there are various versions that support PHP4.

Tarballs themselves include some docs and examples - look into 'docs/' folder


Top
 Profile  
 
 Post subject: Re: PHP4
PostPosted: Mon Feb 28, 2011 5:57 pm 
Offline
Forum Newbie

Joined: Mon Feb 28, 2011 1:51 pm
Posts: 6
Not sure what you mean by Tarballs.

Looked in docs folder - saw lots of stuff, but nothing that I could determine was an example.


Top
 Profile  
 
 Post subject: Re: PHP4
PostPosted: Mon Feb 28, 2011 7:53 pm 
Offline
Moderator
User avatar

Joined: Mon Nov 03, 2003 7:13 pm
Posts: 5919
Location: Odessa, Ukraine
tarball is a .tar.gz (or .tgz, or .tar) file

SwiftMailer 2.x used to contain several examples in its distribution, but it seems those are no longer in the tarball for SwiftMailer 3.x

Docs for 3.x is here: http://swiftmailer.org/wikidocs/


Top
 Profile  
 
 Post subject: Re: PHP4
PostPosted: Tue Mar 01, 2011 3:17 pm 
Offline
Forum Newbie

Joined: Mon Feb 28, 2011 1:51 pm
Posts: 6
Thank you for this information - it helped me to send out my first e-mail.

Questions:

1) Is there are a way to do something like:
$recipients->addTo("webmaster@azthoa.com", "AZT Webmaster");
to set the email address and the name belonging to the e-mail address for the sender?

2) I have a distribution list of 1300 people. Is it best to send out 1300 e-mails, or group them in groups of, say, 100 per e-mail, sending out 13 e-mails? Of course, I'd use BCC when applicable.

3) Is there a limit of how many e-mails or e-mail address one can send to within a specified timeframe? When experimenting with PhpMailer, it stopped working at 900, regardless if I sent them one at a time or in groups of 100. Maybe I wasn't waiting long enough between messages, or something else that I'm not aware of.

Thank you in advance!


Top
 Profile  
 
 Post subject: Re: PHP4
PostPosted: Tue Mar 01, 2011 4:01 pm 
Offline
Moderator
User avatar

Joined: Mon Nov 03, 2003 7:13 pm
Posts: 5919
Location: Odessa, Ukraine
azthoa wrote:
1) Is there are a way to do something like:
$recipients->addTo("webmaster@azthoa.com", "AZT Webmaster");
to set the email address and the name belonging to the e-mail address for the sender?

Api docs wrote:
class Swift_RecipientList:
....
void addTo (mixed $address, [string $name = null])
....

Quote:
2) I have a distribution list of 1300 people. Is it best to send out 1300 e-mails, or group them in groups of, say, 100 per e-mail, sending out 13 e-mails? Of course, I'd use BCC when applicable.

My understanding is that BCC'd emails are more likely to end up in a spam folder, however if it works ok in your case - by all means try to offload sending process to the smtp server - meaning 'bcc:<1300 recipients>' is a preferred method from the performance standpoint.
Quote:
3) Is there a limit of how many e-mails or e-mail address one can send to within a specified timeframe? When experimenting with PhpMailer, it stopped working at 900, regardless if I sent them one at a time or in groups of 100. Maybe I wasn't waiting long enough between messages, or something else that I'm not aware of.

This would likely depend on the smtp server settings.


Top
 Profile  
 
 Post subject: Re: PHP4
PostPosted: Tue Mar 01, 2011 4:20 pm 
Offline
Forum Newbie

Joined: Mon Feb 28, 2011 1:51 pm
Posts: 6
I guess that I didn't ask the right question:

The addTo("address@youremail.com", "Persons Name"); allows you to send a message to: Persons Name <address@youremail.com>.

The $swift->send($msg, $recipients, "sender@myemail.com"), doesn't allow me to have the from address in the email message as: My Name <sender@mymail.com>. Is there a way to have the from address in the email message be: My Name <sender@mymail.com>?


Top
 Profile  
 
 Post subject: Re: PHP4
PostPosted: Tue Mar 01, 2011 4:27 pm 
Offline
Moderator
User avatar

Joined: Mon Nov 03, 2003 7:13 pm
Posts: 5919
Location: Odessa, Ukraine
azthoa wrote:
Is there a way to have the from address in the email message be: My Name <sender@mymail.com>?

Api docs wrote:
mixed $from: The address to send the message from. Can either be a string or an instance of Swift_Address.

Syntax: [ Download ] [ Hide ]
//....
$sent = $swift->send($message, $recipients, $from =& new Swift_Address("sender@mymail.com", "My Name"));
 


Top
 Profile  
 
 Post subject: Re: PHP4
PostPosted: Tue Mar 01, 2011 5:58 pm 
Offline
Forum Newbie

Joined: Mon Feb 28, 2011 1:51 pm
Posts: 6
Thank you very much for the prompt responses!

I have been able to send my first e-mail as I would like. Tomorrow, I'll start testing for multiple addresses.


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

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 0 guests


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:  
cron
Powered by phpBB® Forum Software © phpBB Group