DigDeep

Send email using Blat

8 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

well, I even tried with below changes but it still does not sends email.

Run(@WindowsDir & "\blat.exe -to " & $TO & " -subject " & $SUBJECT & " -body " & $body & " -server " & $SMTPADD & " -f " & $f)

Share this post


Link to post
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?

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Ah! made such a silly mistake... In the FROM ADDRESS, I gave username.Domain.com instead of username@domain.com.

I corrected this and it is working now.

 

Thanks all.

Edited by DigDeep

Share this post


Link to post
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