I use this script, modified from another post here on the board.
put an embeded browse (table name Send_To) on a form then add a button with this script. It will ask you to select a template and then send to all addresses in the browse. using the internal client
Add an import records button for the table and you have your own spam factory :)
cheers
Marc
if is_object(topparent.this) then
form_name = topparent.name()+".this"
else
form_name = ""
end if
template_name = alltrim(ui_get_email_templates())
if template_name = "" then
end
end if
tbl=table.current(1)
tbl.fetch_first()
While .not. tbl.fetch_eof()
template_text = a5_get_saved_email(template_name)
dim em as p
'A5_email_parser() parses out the different sections of the e-mail template
em = a5_email_parser(template_text)
'The template may have stored expressions rather than constant values for the address components.
'Expressions will be prefixed with '='.
'a5_eval_expression() will evaluate any expressions that are prefixed with '=' in the context of the current form.
to_var = a5_eval_expression("=alltrim(Send_To)")
param_to = to_var
param_subject = a5_eval_expression(em.subject_temp)
param_cc = ""
param_bcc = ""
'Template message may have mail merge commands. a5_mailmerge() evaluates the mail merge commands.
param_message = a5_mailmerge(em.message_body_temp,form_name)
'Put attachments into a zip file if more than one attachment is specified
if w_count(em.attachments_temp,crlf()) > 1 then
zipfile = file.temp_create(file.temp_path_get())+".zip"
zip_files(zipfile,em.attachments_temp,.t.)
param_attachments = zipfile
else
param_attachments = em.attachments_temp
end if
'Send the e-mail message directly - do not open the Alpha Five e-mail client
send_result = email_send(param_to,param_subject,param_message,param_attachments,param_cc,param_bcc,.t.,"")
tbl.fetch_next()
end while
ui_msg_box("Email Status","Email Sent")
end
put an embeded browse (table name Send_To) on a form then add a button with this script. It will ask you to select a template and then send to all addresses in the browse. using the internal client
Add an import records button for the table and you have your own spam factory :)
cheers
Marc
if is_object(topparent.this) then
form_name = topparent.name()+".this"
else
form_name = ""
end if
template_name = alltrim(ui_get_email_templates())
if template_name = "" then
end
end if
tbl=table.current(1)
tbl.fetch_first()
While .not. tbl.fetch_eof()
template_text = a5_get_saved_email(template_name)
dim em as p
'A5_email_parser() parses out the different sections of the e-mail template
em = a5_email_parser(template_text)
'The template may have stored expressions rather than constant values for the address components.
'Expressions will be prefixed with '='.
'a5_eval_expression() will evaluate any expressions that are prefixed with '=' in the context of the current form.
to_var = a5_eval_expression("=alltrim(Send_To)")
param_to = to_var
param_subject = a5_eval_expression(em.subject_temp)
param_cc = ""
param_bcc = ""
'Template message may have mail merge commands. a5_mailmerge() evaluates the mail merge commands.
param_message = a5_mailmerge(em.message_body_temp,form_name)
'Put attachments into a zip file if more than one attachment is specified
if w_count(em.attachments_temp,crlf()) > 1 then
zipfile = file.temp_create(file.temp_path_get())+".zip"
zip_files(zipfile,em.attachments_temp,.t.)
param_attachments = zipfile
else
param_attachments = em.attachments_temp
end if
'Send the e-mail message directly - do not open the Alpha Five e-mail client
send_result = email_send(param_to,param_subject,param_message,param_attachments,param_cc,param_bcc,.t.,"")
tbl.fetch_next()
end while
ui_msg_box("Email Status","Email Sent")
end
Comment