Should I be sending emails better?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Mightywayne
Forum Contributor
Posts: 237
Joined: Sat Dec 09, 2006 6:46 am

Should I be sending emails better?

Post by Mightywayne »

The following is how I send my emails:

Code: Select all

$subject = "Subject";
$message = "What I tell them and stuff.";
$message = wordwrap($message, 90); // just to be neat, of course.
$from = "noreply@burnttoastonline.com";
$headers = "From: $from";
mail($email,$subject,$message,$headers);
However, people aren't always getting their emails. Sometimes they're filed as junk, sometimes they just don't send. Now I have a crappy shared server, I know that. But my PHPBB forum doesn't seem to have a problem sending mail out, though I do remember one user on the IPB forum did have trouble.

Am I doing anything wrong? Also, I want to add HTML in later on... will that get my emails filed as spam or just not sent, too?
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

You report two problems: 1) emails filed as junk and 2) emails don't send. Probably not much you can do about the former, but you can track down the problems with the latter. Is the problem invalid email addresses or some server error?
(#10850)
staar2
Forum Commoner
Posts: 83
Joined: Fri Apr 06, 2007 2:57 am

Post by staar2 »

You could use swift mailer. :roll:
Mightywayne
Forum Contributor
Posts: 237
Joined: Sat Dec 09, 2006 6:46 am

Post by Mightywayne »

Err, no...? The emails are sent fine... if they were invalid emails, I'd know how to fix that...

And I don't know if there's a server error, I'm wondering if that's the best way to go about mailing.

Swift Mailer seems great, I'm gonna read more into it after I finish this other coding. --;
Post Reply