SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
E-mail Query Results

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
E-mail Query Results
Author Message
Jeff



Joined: 29 Apr 2002
Posts: 37

Post E-mail Query Results Reply with quote

I would like to query a database and then send the results of that query in the body of an e-mail. I can successfully query the database using the DatabaseRetrieve command and get the rows into the "buffer" but I'm not sure how to get them from the buffer to the body of the e-mail message. Thanks for your help!

Tue May 31, 2005 10:11 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7975

Post Re: E-mail Query Results Reply with quote

Assuming that the buffer is a variable name, all you need to do is

DatabaseSave "somefile.txt", "TXT", rows
FileReadAll "somefile.txt", buffer
MailSend "Account/Profile name", "password", "me@mycomp.com", "Subject", buffer

If you use SMTP email interface with text/HTML format option you can save the file in HTML format with column headers, tables, etc... rather then as a plain text file.

A more simple and elegant method is to send it as an attachment

DatabaseSave "somefile.xls", "XLS", rows
MailSendWithAttachment "Account/Profile name", "[password]", "[me@mycomp.com]", "Subject", "See attached report", "somefile.xls"

: I would like to query a database and then send the results of that query in
: the body of an e-mail. I can successfully query the database using the
: DatabaseRetrieve command and get the rows into the "buffer" but
: I'm not sure how to get them from the buffer to the body of the e-mail
: message. Thanks for your help!

Tue May 31, 2005 11:06 am View user's profile Send private message
Jeff



Joined: 29 Apr 2002
Posts: 37

Post Re: E-mail Query Results Reply with quote

Thanks, it looks like saving the file in html format and sending in the body of the message is the best option for us. Thanks for your help!

: Assuming that the buffer is a variable name, all you need to do is

: DatabaseSave "somefile.txt", "TXT", rows
: FileReadAll "somefile.txt", buffer
: MailSend "Account/Profile name", "password",
: "me@mycomp.com", "Subject", buffer

: If you use SMTP email interface with text/HTML format option you can save the
: file in HTML format with column headers, tables, etc... rather then as a
: plain text file.

: A more simple and elegant method is to send it as an attachment

: DatabaseSave "somefile.xls", "XLS", rows
: MailSendWithAttachment "Account/Profile name",
: "[password]", "[me@mycomp.com]", "Subject",
: "See attached report", "somefile.xls"

Tue May 31, 2005 12:03 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.