Jump to content

Send email using Blat


DigDeep
 Share

Recommended Posts

Hi,

Can someone please tell me what am I doing wrong here.

I am able to run the Blat Install successfully but email part does not work.

RunWait(@ComSpec & " /c " & "blat -install smtp.SERVER ADDRESS " & @UserName & "@DOMAIN ADDRESS 3 25 - - - -", "", @SW_HIDE)

Local $SMTPADD = "smtp.SERVER ADDRESS"
Local $SUBJECT = "Test"
Local $TO = "TO ADDRESS"
Local $f = "FROM ADDRESS"
Local $body = "This is a Test message"
Local $log = "log.txt"

RunWait("blat.exe -server """ & $SMTPADD & """ -s """ & $SUBJECT & """ -body """ & $body & """ -t """ & $TO & """ -f """ & $f & """ -log """ & $log & """", "", @SW_HIDE)

 

Edited by DigDeep
Link to comment
Share on other sites

I don't know Blat but I think you need to use single quotes around the entire expression inside the parenthesis instead of double quotes.  Use double quotes inside the singles.  Also, RunWait might work (do you need the wait part?) but I would also look at ShellExecute.

Build your own poker game with AutoIt: pokerlogic.au3 | Learn To Program Using FREE Tools with AutoIt

Link to comment
Share on other sites

Can you write that string to console just before you try to send it?

Do something like this:

Local $mycommandline = @WindowsDir & "\blat.exe -to " & $TO & " -subject " & $SUBJECT & " -body " & $body & " -server " & $SMTPADD & " -f " & $f
ConsoleWrite($mycommandline & @CRLF)

Just before the Run() command. I would like to see how AutoIt interprets your varaibles.

Skysnake

Why is the snake in the sky?

Link to comment
Share on other sites

Your variables have no spaces after them ... so the flags would be appended like this:

TO ADDRESS-subject

Edit: or maybe the flags have spaces but they are hard to see - I agree with @Skysnake - look at the string first.  Also, have you tried with ShellExecute?

Edited by Jfish

Build your own poker game with AutoIt: pokerlogic.au3 | Learn To Program Using FREE Tools with AutoIt

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...