Sending email from results of a Recordset

This is a discussion on "Sending email from results of a Recordset" within the PHP Forum section. This forum, and the thread "Sending email from results of a Recordset are both part of the Program Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Mar 8th, 2008, 22:21
New Member
Join Date: Mar 2008
Location: UK
Age: 29
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Cool Sending email from results of a Recordset

Hi

Following on from my earlier post, I now need to know how to set the variables of my mailer script to the information stored in the recordset.

For example, my recordset is called rsLast, and I want to send a pre-determined welcome/confirmation email to new members...

Here's what I have so far, but it's not working - can someone please spot the problem....

PHP: Select all

<?php
    $mailtoname 
"row_rsLast['fname']  row_rsLast['lname']";
    
$mailfromname "Test Server";
    
$mailtoaddress "row_rsLast['email']";
    
$mailtocomplete "row_rsLast['fname'] <$mailtoaddress>";
    
mail($mailtocomplete"Welcome to the Member's Zone!""Message body goed here");
?>
I tried putting dollar signs in front of the recordset variables but it doesn't like this.

It's probably glaring me in the face but I can't see it!

Thanks in advance

John
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Mar 8th, 2008, 22:45
alexgeek's Avatar
Moderator

SuperMember
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 3,812
Blog Entries: 9
Thanks: 2
Thanked 2 Times in 2 Posts
Re: Sending email from results of a Recordset

You have to surround them in curly braces with a dollar sign if it's an array, e.g.:
PHP: Select all

    $mailtoaddress "{$row_rsLast['email']}"
Or if that doesn't work still:
PHP: Select all

    $mailtoaddress $row_rsLast['email']; 

Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Mar 8th, 2008, 23:00
New Member
Join Date: Mar 2008
Location: UK
Age: 29
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Sending email from results of a Recordset

Hey Alexgeek

Thanks for that - works great!

John
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Thread Tools

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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP email form not sending email Kurt PHP Forum 1 Oct 12th, 2007 04:26
sending email arrays with php ppgpilot PHP Forum 2 Jan 25th, 2007 16:49
Email + attachment sending manzil PHP Forum 1 Aug 4th, 2006 13:40
Sending Email Paul00000001 JavaScript Forum 3 Jul 29th, 2006 03:16
Sending email Paul00000001 PHP Forum 6 Jul 10th, 2006 11:49


All times are GMT. The time now is 18:14.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42