formatting an email

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Glenn Boyce
Posts: 137
Joined: Thu Jul 24, 2008 11:22 pm

formatting an email

Post by Glenn Boyce » Tue Oct 14, 2008 11:25 pm

I'm trying to set up an email order confirmation and I want to put various bits of text on different lines. I can get the email bit to work and I thought Linefeed would allow me to place what I wanted on each line. Code attached and suggestions welcome

Code: Select all

on mouseUp
  revmail fld "Memail",, "Confirmation of Order", "Dear " & fld "Mcontact" & ","  
  linefeed
  "Thank you for your order No" && fld "CustOrderNo" & " which has now been processed." 
  linefeed
  "Expected delivery is " & fld "dateReqd" 
end mouseUp

SparkOut
Posts: 2947
Joined: Sun Sep 23, 2007 4:58 pm

Post by SparkOut » Tue Oct 14, 2008 11:51 pm

The message body is just one string, so you are passing it only the first line.

Try adding "&" before and after the linefeeds to concatenate the string.
Or build up the message text in a variable and just pass that one variable to the revMail command.

Code: Select all

on mouseUp
  local tMsgBody
  put "Dear" && fld "Mcontact" & "," & lf into tMsgBody
  put  "Thank you for your order No" && fld "CustOrderNo" && "which has now been processed." & lf after tMsgBody
  put "Expected delivery is" && fld "dateReqd" & lf after tMsgBody
  revmail fld "Memail",, "Confirmation of Order", tMsgBody
end mouseUp
Last edited by SparkOut on Tue Oct 14, 2008 11:55 pm, edited 1 time in total.

Glenn Boyce
Posts: 137
Joined: Thu Jul 24, 2008 11:22 pm

Post by Glenn Boyce » Tue Oct 14, 2008 11:55 pm

man that was quick!! I'll give both a try

Thanks

SparkOut
Posts: 2947
Joined: Sun Sep 23, 2007 4:58 pm

Post by SparkOut » Tue Oct 14, 2008 11:58 pm

And you were quick too! I added a code snippet but you'd already replied.
Good luck anyway.

Post Reply