batfastad Posted December 15, 2004 Share Posted December 15, 2004 HiI'm writing a backup script and it's working pretty well.I'm trying to get it to send a confirmation e-mail once it's finished and for that I'm using a command line SMTP tool called BMail.My code at the moment is...;SEND CONFIRMATION E-MAIL Run ("C:\admin\bmail.exe -s smtp.domain.com -f from@email.com -t to@email.com -h -a "Backup completed successfully" -b "Backup completed successfully" ")But obviously that causes a parse error at runtime because of the "" quote marks around some of the statements in the command.In order to have spaces in the subject and e-mail body, I have to have quote marks around the text after the -a (subject) and -b (body) switches.How do I do this?I've tried escaping them and I still get the parse error.I've tried converting them to apostrophes but the command just sends the apostrophe and the first word up until the space.I don't want to have to open a command box and send the keystrokes of the command unless there's no other way.Any ideas?ThanksBatfastad Link to comment Share on other sites More sharing options...
trids Posted December 15, 2004 Share Posted December 15, 2004 Try replacing the outermost ones (only) with apostrophes .. ;SEND CONFIRMATION E-MAIL Run ('C:\admin\bmail.exe -s smtp.domain.com -f from@email.com -t to@email.com -h -a "Backup completed successfully" -b "Backup completed successfully" ') .. and just in case: make sure the Run() is all on one line, as you haven't used any line-continuations ("_") Link to comment Share on other sites More sharing options...
SumTingWong Posted December 15, 2004 Share Posted December 15, 2004 (edited) HiI'm writing a backup script and it's working pretty well.I'm trying to get it to send a confirmation e-mail once it's finished and for that I'm using a command line SMTP tool called BMail.My code at the moment is...;SEND CONFIRMATION E-MAIL Run ("C:\admin\bmail.exe -s smtp.domain.com -f from@email.com -t to@email.com -h -a "Backup completed successfully" -b "Backup completed successfully" ")But obviously that causes a parse error at runtime because of the "" quote marks around some of the statements in the command.In order to have spaces in the subject and e-mail body, I have to have quote marks around the text after the -a (subject) and -b (body) switches.How do I do this?I've tried escaping them and I still get the parse error.I've tried converting them to apostrophes but the command just sends the apostrophe and the first word up until the space.I don't want to have to open a command box and send the keystrokes of the command unless there's no other way.Any ideas?ThanksBatfastad<{POST_SNAPBACK}>;SEND CONFIRMATION E-MAIL Run ('C:\admin\bmail.exe -s smtp.domain.com -f from@email.com -t to@email.com -h -a "Backup completed successfully" -b "Backup completed successfully" ')OR;SEND CONFIRMATION E-MAIL Run ("C:\admin\bmail.exe -s smtp.domain.com -f from@email.com -t to@email.com -h -a ""Backup completed successfully"" -b ""Backup completed successfully"" ")DOH!....you beat me to it Trids Edited December 15, 2004 by pacman Link to comment Share on other sites More sharing options...
batfastad Posted December 15, 2004 Author Share Posted December 15, 2004 Excellent! Thanks guys - sorted and working now! Thanks again Batfastad Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now