Resolved smtpMail and creating email

bigwill

Member
Hi guys

I am trying to get smtpMail to create and send me a email with text in multiple columns/formatted text. I do not want my "text" in a attachment. I am simply trying to fill out body in a email

This works fine if all text start from left, but if i try to build up text in 2 columns the mail looks bad (looks great if i change to Courier New font i outlook :) )

A small sample code to demonstrate

Code:
{included files for smtp procedure.....}
def var col1 as char format "x(60)" no-undo.
def var col2 as char format "x(60)" no-undo.

form col1 
    col2 with no-box no-labels width 124 frame mail-frame.

def var cFile as char no-undo.
assign cFile = "RequisitionReport".
output to value(cFile).

display "Order from:" @ col1 with frame mail-frame.
display "Order date: " + string(today) @ col2 with frame mail-frame.
down with frame mail-frame.

display "Order type: " + string(4) + " " + string("Some nice text") @ col2 with frame mail-frame.
down with frame mail-frame.

display "Customer name" @ col1 with frame mail-frame.
display "Fax:" + string(222222222) @ col2 with frame mail-frame.
down with frame mail-frame.

display "Customer address" @ col1 with frame mail-frame.
display "Phone:" + string(555555) @ col2 with frame mail-frame.
down with frame mail-frame.

output close.


/* Send contant of file as body in email */
def var lSuccessfull as log no-undo.
def var cReturnMessage as char no-undo.

run sendSMTPmail("lars.erik.nes@infocare.no"                          /* to */
                ,"auto-mailer@infocare.no"                          /* from */
                ,""                                                  /* cc */
                ,""                                                  /* attatchment */
                ,""                                                  /* local file */
                ,"New order " + string(99999)                        /* subject */
                ,""                                                  /* body */
                ,""                                                  /* MIME */
                ,"file"                                              /* body type */
                ,cFile                                              /* body file */
                ,output lSuccessfull
                ,output cReturnMessage).

The result is attached.

Is it possible to create a nice formatted text in multiple columns as body-text in a email ?
Is it possible to change font to Courier New in the sendSmtpMail ??
 

Attachments

  • 2013-09-09_12h37_38.png
    2013-09-09_12h37_38.png
    5.9 KB · Views: 9

Stefan

Well-Known Member
How would you normally create an email with two columns?

Plain mail is plain text (and will only look ok if the reader has plain mail set to use a non-proportional font). To use formatting you will need to send the mail as HTML - not everybody appreciates HTML mail.
 

TomBascom

Curmudgeon
Your issue is not smtpMail per se. The server does not control the presentation. The problem is, as Stefan says, that plain old text only formats nicely if the *user* happens to be using a fixed width font. If you *know* that your users can accept formatted e-mail (such as HTML) then that option will be prettiest. But if your audience has unknown capabilities that might not be such a good idea. So the first thing to do is to figure out who the users are and if they can accept formatted e-mail.
 
Top