Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hello Everybody!
I need some help to figure out this:
i have a .net email applicaction that runs from command prompt, and it attaches a txt file to the email and sends it.
You pass the from, to, subject and body of the email as parameters.
is there a way to read from this textfile (about 4 lines of text though it varies), save the content of the file in a variable and pass the content of this variable as the mail body paremeter??
Example:
i run the application like this:C:\JLMail from@mail, to@mail, subject, body, "C:\attachment.txt"
so instead of writing this, save the content of the file:
1: failed
2: ok
3: failedto a variable and type this in the command prompt instead?:
C:\JLMail from@mail, to@mail, subject, body, %variable%
Any Help will be appreciated.
thnx a lot

Since the end of a var is defiled by a line break, I can't see how.
Some command line mailers will let you send a FILE as the body. [As well as attachments.]
Like this one:
===============================
Usage: mailto options
mailto v1.6 Copyright (c) 1998 Scott Beasley
Options are:
-U sender id -D user ids -H smtp_host
[-S subject] [-R Return path]
[-M Message] [-MF Message file name]
[-CC user ids] [-BCC user ids]
[-AB Binary file names] [-AT Text file names]
[-C config file] [-I section name]
[-RC retry count] [-RW seconds to wait between each retry]
[-DEBUG] [-N user id]
=====================================
If at first you don't succeed, you're about average.M2

Or maye putting all the lines in a single one, separated by a dash (line1-line2-line3)??
and save that into the variable??
My mailing application has the ability to attach the file to the message, but i want the content of the file in the body because it will be visualized through a mobile phone
thnx a lot

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |