close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Multiple email recipients from a database

Thread began 11/23/2010 12:58 pm by john.cummins125554 | Last modified 12/06/2010 1:55 pm by Dani Chankhour | 1640 views | 9 replies |

john.cummins125554

Multiple email recipients from a database

Hi I’ve got a simple database containing name, email and opt-in info.

I’ve created an email template and I have been able to send a test to each of the email address’
However, I would like to add the recipients name to their email but when I add a recordset to the email template I get an error...
“Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in D:\Domains\mccarthy-design.com\wwwroot\HGYO\eNOV10.php on line 38”

when I remove the recordset, I don’t get the error

How do I add the name field without a recordset?

Sign in to reply to this post

Dani Chankhour

Try changing the require_once into require for the connection folder. It could be that your connection folder is already included somewhere else on the page.

Sign in to reply to this post

john.cummins125554

OK, that got rid of the error message, thanx.


I've added the code to display the name
<?php echo $row_rsMAIL['mlNAME']; ?>

however, this is always displaying the first name in the database what do I need to do to add the relevant name from the database to each email?

Sign in to reply to this post

Dani Chankhour

Try replacing

$row_rsMAIL

with

$RecipArray[$RecipIndex][0]

Sign in to reply to this post

john.cummins125554

still no joy

I've tried that....
<?php echo $RecipArray[$RecipIndex][0]['mlNAME']; ?>

I've also tried
<?php echo $RecipArray[$RecipIndex][0]; ?>

and nothing appears

Sign in to reply to this post

Dani Chankhour

Can you please send me your page that includes the Universal Email server behavior in addition to the email template that is located in the webassist/email folder.

Sign in to reply to this post

john.cummins125554

here's the email send page and template

Attached Files
SendEMAIL.zip
Sign in to reply to this post

Dani Chankhour

Thanks.

It looks like you are using a file as your email template. Therefore we have to make some variables global in order to use them.

On the top of your eNOV10.php page paste the following piece of code:

<?php
global $RecipArray;
global $RecipIndex;
?>

Let me know if this does not work.

Sign in to reply to this post

john.cummins125554

Success

that did it,

many thanks Dani

Sign in to reply to this post

Dani Chankhour

I'm glad i was able to help.

I'm sure a lot of people will find this helpful as well.

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...