Forum Moderators: coopster

Message Too Old, No Replies

Creating Mailing List for Personal Experience, Suggestions?

         

dkin

1:06 am on Aug 12, 2004 (gmt 0)

10+ Year Member



I am trying to create a mailing list script to further myself in php and open myself up to new functions I have never used.

This being said, before I start I would like a few suggestions on maybe what to remember, watch out for, functions to use, or even a bit of easier script to create that will get me familiar with these same practises.

Any help is appreciated.

Cheers

coopster

5:00 pm on Aug 12, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I have to give you some credit here, dkin, of all the areas to choose from, mail is probably among the most difficult. I'm not trying to scare you off, just want you to know that you will learn quite a bit going down this road.

>>what to remember,

Different operating systems use different line endings. [webmasterworld.com]
Different operating systems use different Mail Transfer Agents (MTA) [php.net]

>>watch out for,

correct headers, spam filters

>>functions to use,

mail() [php.net]

>>or even a bit of easier script

You may want to peel into one of the more popular message boards scripts, checkout PEAR, or even search for PHP mail tutorials. There are quite a few tips on the mail() function page including this tutorial [zend.com].

dkin

5:11 pm on Aug 12, 2004 (gmt 0)

10+ Year Member



will I need to use anything like fopen(). I have seen this in many mailing scripts and it seems fairly popular, is this needed?

coopster

5:31 pm on Aug 12, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Only if you are getting your message data from a file. Your first test should be really simple, something like this...
<?php 
$to = 'me@example.com';
$from = 'me@example.com';
$subject = 'This is my subject';
$message = 'This is my message';
ini_set('sendmail_from', $from);
mail($to, $subject, $message);
?>
...to make sure you have everything configured correctly on the server. Then you can move on to the fun stuff, like attachments, HTML mail, etc.

dkin

6:48 pm on Aug 12, 2004 (gmt 0)

10+ Year Member



I see you are using single quotes. Would it be a problem if I used "? I have no preference just want to know.

coopster

7:01 pm on Aug 12, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



You can use either single or double quotes [php.net]. The difference is whether or not you want PHP to look through the string to try and locate any variables to expand. Using single quotes saves PHP that step.