Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Multiple PHP Mail Via SMTP
Old 08-28-2007, 02:18 PM Multiple PHP Mail Via SMTP
Biron's Avatar
Skilled Talker

Posts: 76
Name: Alan Biron
Trades: 1
OK, I got a script the takes a users msn/gmail contacts and invites them to join a site. But I would like to send these via SMTP so that they don't end up in people's junk mail folder. Can anyone help me out with this??


Here is the code for sending the messages.

Code:
<?PHP
session_start ();
$sendaddress = $_SESSION["memberemail"];
// Change subject to whatever you want subject to be
$subject = "$sendaddress Invites you to join";
 
// Change this message to whatever you want the body of the email to be
$message = "$sendaddress wants your to checkout the free online arcade and humor videos site www.arcadeoutlaw.com.\n\nIf your bored this is an awesome way to kill some time, and some of the videos will keep you laughing for days. \n\n\nGo check it out, it's free!\n\n\n\nwww.arcadeoutlaw.com";
$extra_header = "From: $sendaddress\r\nReply-To: $sendaddress";
foreach ($_POST['emails'] as $email){
 
        mail($email, $subject, $message, $extra_header);
 
}
 
echo "Emails sent to contacts from<br/><br/>" ;
echo $sendaddress; 
echo "<br/><br/></br>";
?>
Biron is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-28-2007, 08:57 PM Re: Multiple PHP Mail Via SMTP
Biron's Avatar
Skilled Talker

Posts: 76
Name: Alan Biron
Trades: 1
Will pay if anyone can help me
Biron is offline
Reply With Quote
View Public Profile
 
Old 08-29-2007, 08:26 AM Re: Multiple PHP Mail Via SMTP
dansgalaxy's Avatar
Defies a Status

Posts: 6,521
Name: Dan
Location: Swindon
Trades: 0
If you have MSN/yahoo add me dansgalaxy@hotmail.co.uk

I'm just checking out how this is best done.

i think however (untested) you can just add a bunch of headers into mail() which help preventing it being dumped into the junk folders.

Add me and we can discuss what you need more

Dan
__________________
Discounted Web Hosting With XDnet!
>> Get 25% of hosting~ Promo: Webmaster-talk <<

Please login or register to view this content. Registration is FREE
dansgalaxy is offline
Reply With Quote
View Public Profile Visit dansgalaxy's homepage!
 
Old 08-29-2007, 09:56 AM Re: Multiple PHP Mail Via SMTP
metho's Avatar
Ultra Talker

Posts: 481
Location: Gold Coast - Brisbane QLD, Australia
Trades: 0
phpmailer has been the defacto standard for meeting flexible email requirements in php apps for a long time. It'd be in the top 10 list of classes to get to know well.
__________________
I do
Please login or register to view this content. Registration is FREE
based.
Spend a lot of time in
Please login or register to view this content. Registration is FREE
.
And
Please login or register to view this content. Registration is FREE
chews up the rest.
metho is offline
Reply With Quote
View Public Profile Visit metho's homepage!
 
Old 08-29-2007, 10:41 AM Re: Multiple PHP Mail Via SMTP
Biron's Avatar
Skilled Talker

Posts: 76
Name: Alan Biron
Trades: 1
I tried to get phpmailer to work, but couldn't seem to get it to send with the script I have setup.
Biron is offline
Reply With Quote
View Public Profile
 
Old 08-29-2007, 07:16 PM Re: Multiple PHP Mail Via SMTP
Skilled Talker

Posts: 62
Name: Tom Wright
Location: Brighton, UK
Trades: 0
OK, if you have access to your server, you should definitely try the PEAR mailer class: http://pear.php.net/package/Mail
It's very robust, flexible and works great with smtp.
Bear in mind though, that you'll have to use a different syntax to the one you describe above.
__________________
My site:
Please login or register to view this content. Registration is FREE
tomythius is offline
Reply With Quote
View Public Profile
 
Old 08-29-2007, 08:03 PM Re: Multiple PHP Mail Via SMTP
dansgalaxy's Avatar
Defies a Status

Posts: 6,521
Name: Dan
Location: Swindon
Trades: 0
i saw something about the pear one i really must learn more about it, at the moment im only familiar with mail() i have a script at the moment and i have a ton of headers in it which are suposidle help stop it being junked.

but when i first sent a email with this thing it went into my inbox (im using windows mail replacment for outlook express with vista) but all emails after that are going to junk no clue why.
__________________
Discounted Web Hosting With XDnet!
>> Get 25% of hosting~ Promo: Webmaster-talk <<

Please login or register to view this content. Registration is FREE
dansgalaxy is offline
Reply With Quote
View Public Profile Visit dansgalaxy's homepage!
 
Reply     « Reply to Multiple PHP Mail Via SMTP
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.24436 seconds with 12 queries