Qbasicnews.com

Full Version: creating an email document
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I have a qb program which creates a list of data in which I would like to email certain people. Is there a way to take this data in qb and create (transfer to ) an email document?? Any help or guidance is appreciated.
What do you mean? Are you trying to create an email then send it to the recipient by using a QB program? If so, ask someone else that's smart Tongue

Or do you mean converting a .bas file to an email source code? You could do something like this:
Code:
INPUT "what info would you like to send? ", info$
INPUT "what color would you like your font to be? ", clr
INPUT "who do you want to send it to? ", address$
INPUT "what would you like to save the file as? ", filen$
filename$ = filen$ + ".html"
PRINT #1, <html>
PRINT #1, <head> filen$ </head>
OPEN filename$ for output as #1
IF clr = 1 then PRINT #1, < font color = "blue">
IF clr = 2 then PRINT #1,  < font color = "green">
if clr = 3 then print #1, <font color = "cyan">
'and so forth..
PRINT #1, info$
PRINT #1, <a href = "mailto:" address$ ">
PRINT #1, </html>

Not that hard, it justs involves putting html tags around whatever. Most email documents are very similar to .html files, I'm not sure whatever there extension is or even if they have a specific file type. Sorry if this doesnt help :/
What do you mean? Are you trying to create an email then send it to the recipient by using a QB program? If so, ask someone else that's smart Tongue

Or do you mean converting a .bas file to an email source code? You could do something like this:
Code:
INPUT "what info would you like to send? ", info$
INPUT "what color would you like your font to be? ", clr
INPUT "who do you want to send it to? ", address$
INPUT "what would you like to save the file as? ", filen$
filename$ = filen$ + ".html"
PRINT #1, <html>
PRINT #1, <head> filen$ </head>
OPEN filename$ for output as #1
IF clr = 1 then PRINT #1, < font color = "blue">
IF clr = 2 then PRINT #1,  < font color = "green">
if clr = 3 then print #1, <font color = "cyan">
'and so forth..
PRINT #1, info$
PRINT #1, <a href = "mailto:" address$ ">
PRINT #1, </html>

Not that hard, it justs involves putting html tags around whatever. Most email documents are very similar to .html files, I'm not sure whatever there extension is or even if they have a specific file type. Sorry if this doesnt help :/

Oh, and my html may be wrong because I always have a cheatsheet opened when I'm making a webpage. Big Grin

Edit: Sorry about the double post >_>
Lets say I have a .bas file, and I want to be able to convert it to an email source code. And then be able to send it to known addresses.
Couldn't you just copy&paste into your email program?
Quote:Lets say I have a .bas file, and I want to be able to convert it to an email source code. And then be able to send it to known addresses.

Yeah, the source code for email is pretty much html like I showed you. If you are trying to then send it to the person from a qb program, that will take some knowledge to do.
Even if I could just be able to use it as an attachment and then use email to send it. Right now my program just prints a report to the printer, but I would like it to print to a file where it could be then used with my email. Make any sense??
oh so you want to print the output to a file? Well I can think of two ways of doing this:

1. In windows, set your printer properties to print to a file.
2. Replace all the lp(or whatever you use to print) with print # which will send the output a file.
I know how to print to a file, but I am having trouble making it a file that is readable in the email program like a html file. Anyone with any other advice or help is appreciated.

I would like to go into email, create a document, and add this file as an attachment that is readable in email.
Um...you read the source I gave you, right? That converts it to html. I just didnt fully finish it...If you know html you could do it yourself.

If you're just trying to attach it....well, just attach it. Wink If your are trying to make a readable file, why not just use your sequential file writing skills to save the info onto a .txt file? if you don't what that is either, then we can take it a step back, okay?
Pages: 1 2