abattoir
2nd April 2013, 00:32
Hi,

I know this has been discussed a lot regarding Email from Unix, but i have a slight different requirment.
I am using Mutt utility to send out emails from my customized session.

My requirement is to send an email with subject line as "New Sales Order 123456 Created" where 123456 is the order number just created and i am finding it very difficult to pass this order number in my subject line.

The Mutt Email syntax is as follows :

mail.str = "/opt/csw/bin/mutt -s ""New Sales Contract Created"&str$(orno)" -a /tmp/Dealers_New_Requirement.xls abc@gmail.com < /home/bsp/pickmailbody.txt"

where s is for subject
a = attachment file path
/home/bsp/pickmailbody.txt = body text
orno = variable storing new created order

The subject line is not fetching the value of order from variable and hence i am failing to achieve my objective.

Regards,
Abattoir

saumya
2nd April 2013, 07:17
Did you try in debugger what value variable "mail.str" is holding. Can you post the code?

abattoir
2nd April 2013, 16:12
Yes, I have done debugging and the issue is the subject line does not understand the variable "orno" and assumes it as string orno, so when the mail is received the subject line bears "New Order Requirement orno".

mark_h
2nd April 2013, 20:17
I would expect the line to look something like this:

mail.str = "/opt/csw/bin/mutt -s " & "New Sales Contract Created" & str$(orno) & " -a /tmp/Dealers_New_Requirement.xls abc@gmail.com < /home/bsp/pickmailbody.txt"

or maybe like this if quotes are needed:

mail.str = "/opt/csw/bin/mutt -s " & chr$(34) & "New Sales Contract Created" & str$(orno) & chr$(34) & " -a /tmp/Dealers_New_Requirement.xls abc@gmail.com < /home/bsp/pickmailbody.txt"

abattoir
3rd April 2013, 00:25
Thanks Mark, 2nd suggestion did work correctly .

Abattoir