This topic is locked

Send mass email from table results

2/26/2007 4:39:08 AM
ASPRunnerPro General questions
M
magikroom author

I'm using the demo version of ASP Runner Pro and will be buying the product if I can do one thing. I've set up a Contacts database using an Access DB (though I want to move this over to SQL) which contains the usual fields, but here they are below:
contactsID (primary key)

firstname

lastname

role (the important bit)

extension

email

section

room

notes

dateEntered
When I produce the table in asprunner, I can search by role and it will give me list of relevant contacts (in this case, all the Project Managers that are stored in the 'role' field)...this allows me to email them individually by clicking on the mailto link, but what I want to be able to do is send a bulk email from the results of the search.
I'm sure that this has been solved before, but could someone provide me with the code needed for this and to tell where exactly it needs to be placed (what asp file) as I'm no expert with regards to programming.
Thanks in aticipation!

Sergey Kornilov admin 2/26/2007

This will require some changes of the list page along with some Event coding.
Contact me directly at support@xlinesoft.com to get more help.

M
mazyad 2/27/2007

Dear Sergey Kornilov,
I suggest a solution to this issue is made public in the forum because many users (I assume) will benefit from your reply.
Sincerely,

Abdulrahman. <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=15880&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' />

S
silk 7/2/2009

I need the same exact thing..could you post a public solution?

thank you

Sergey Kornilov admin 7/2/2009
S
silk 7/2/2009

Check this article for a sample code:

http://www.xlinesoft.com/asprunnerpro/docs...ted_records.htm


this code is perfect, didn't test yet but solves half my needs.

now I can select users as I wish, but I need to send an email to those users based on values in an other table
the other table is the "messages" table, it contains the body, title and sender fields of the email to send
I need to select a record from that table (select the message to send), and send it to the selected users
is it possible?

thank you

J
Jane 7/3/2009

Hi,
yes it's possible.

Just select record from messages table and use selected values in your code.

S
silk 7/3/2009

ok, but I need to select the record from the "messages" table AFTER hitting SEND TO SELECTED button in list page.

I need something like:

-filter users table

-click SEND TO SELECTED

-pick a record from the "messages" table

-send that "message" to selected users
any suggestion?

thank you VERY much..

J
Jane 7/6/2009

Hi,
here are some tips how to send emails to selected users:

  1. proceed to the Visual Editor tab
  2. turn on HTML mode, find this line:
    {BEGIN delete_link}


and add following code just before:

<A onclick="frmAdmin.a.value='update'; frmAdmin.submit(); return false;" href="#">email</A>


And add some code to the BeforeDelete event:

'Delete selected records

if Request.Form("a") = "delete" then

BeforeDelete = True

exit function

end if
'email selected records

if Request.Form("a") = "update" then

'send email here

'select user info is in the deleted_values array

BeforeDelete = False

S
silk 7/6/2009

thank you Jane, didn't tried this code yet but I understand how it works and seems perfect, but I need one more thing:
when I ckick "email selected users", I need to select data from an other table.

the second table stores the email values (the sender, body, title of the email to send)
a possible solution could be to have a list menu with the emails stored in table2, but I don't know how to get the values of table2 and use those values to populate the email fields AFTER selecting which email to send
what I need is send THIS EMAIL to THESE USERS
any suggestion? thank you again..

J
Jane 7/6/2009

Hi,
you can use the save code on another table. Just replace code in the BeforeDelete event:

if Request.Form("a") = "update" then

'save selected email in the session variable

'and redirect to the users page

end if