AzzerShaw
(Seasoned Scripter)
2005-06-09 04:22 PM
Using Blat

'ello Dudes

I have just done a script to send an email containing a txt file using blat.exe, everything sends fine but no document is attached.. the script is below

Code:

Break on

$mailhost = 'mailserver'
$Attachment1 = '"%systemdrive%\temp\IE6Upgrade.txt"'
$Attachment = "c:\temp\SP6Upgrade.txt"
$sender = 'aaron.shaw@@neverumind.co.uk'
$recipient= 'Uber@@neverumind.co.uk'
$mailLine = 'C:\temp\blat.exe $Attachment -to $recipient -server $mailhost -subject "Please Update" '
$mailLine = $mailLine+'-body "blah ablah balajsdsd" -f $sender -q'
Shell $mailLine




Doesnt work or does

Code:
 


Break on

$mailhost = 'mailserver'
$Attachment1 = '"%systemdrive%\temp\IE6Upgrade.txt"'
$Attachment = "c:\temp\SP6Upgrade.txt"
$sender = 'aaron.shaw@@neverumind.co.uk'
$recipient= 'Uber@@neverumind.co.uk'
$mailLine = 'C:\temp\blat.exe c:\temp\SP6Upgrade.txt -to $recipient -server $mailhost -subject "Please Update" '
$mailLine = $mailLine+'-body "blah ablah balajsdsd" -f $sender -q'
Shell $mailLine




Can anyone see anythign wrong with it...im scratching my head... Outlook doesnt appear to be doing anything odd...have tested with outlook 97 and 2003

Cheers

A


LonkeroAdministrator
(KiX Master Guru)
2005-06-09 06:39 PM
Re: Using Blat

you sure there is no switch for the attachment?

oobnuker
(Getting the hang of it)
2005-06-09 06:42 PM
Re: Using Blat

I always do the install routine for blat, or write the following keys:
Code:

HKLM\SOFTWARE\Public Domain\Blat
Sender=sender@somewhere.com
SMTP Port=25
SMTP Server=myserver
TRY=5



And the command line BLAT FILENAME.TXT -to %recipient% -subject %subject%, always works for me. It basically places the contents of FILENAME.TXT as the body of the message.


LonkeroAdministrator
(KiX Master Guru)
2005-06-09 06:52 PM
Re: Using Blat

so, that's not correct.
as he wants an attachment.

iirc, I never got the attachment part working, but I never really needed it either.


AzzerShaw
(Seasoned Scripter)
2005-06-09 06:55 PM
Re: Using Blat

It said in the notes that came with it that the executable was all you needed

Quote:




And the command line BLAT FILENAME.TXT -to %recipient% -subject %subject%, always works for me. It basically places the contents of FILENAME.TXT as the body of the message.






Well that is pretty much what ive done above......ahhh hang on a sec.....



It includes the text file content in the message body? i was using a blank file

I thought it actually attached it.....

lol smeg

Thanks for replies

Aaron


AzzerShaw
(Seasoned Scripter)
2005-06-09 06:58 PM
Re: Using Blat

I dont mind really if its attached or in the body of the message its all good.

Thanks again


oobnuker
(Getting the hang of it)
2005-06-09 07:02 PM
Re: Using Blat

Quote:

so, that's not correct.
as he wants an attachment.

iirc, I never got the attachment part working, but I never really needed it either.




Yeah, I was just offering up my experience in hopes that it might help him out.


oobnuker
(Getting the hang of it)
2005-06-09 07:02 PM
Re: Using Blat

Quote:

I dont mind really if its attached or in the body of the message its all good.

Thanks again




So it works now? Awesome.


LonkeroAdministrator
(KiX Master Guru)
2005-06-09 07:02 PM
Re: Using Blat

well, cool then.

Kdyer
(KiX Supporter)
2005-06-10 06:53 AM
Re: Using Blat

Do we need to update the Examples in the FAQ Section?

Kent


AzzerShaw
(Seasoned Scripter)
2005-06-10 09:35 AM
Re: Using Blat

well it does say

Quote:



Blat - File Attached..






Rather than File content included (or somthing like that...)


oobnuker
(Getting the hang of it)
2005-06-15 01:51 PM
Re: Using Blat

I had a need to send a string as the body of the email and I didn't want to have to write it out to a file, so I set down to figure out the proper command line this morning.

Code:

BLAT - -body "your text here" -to Recipient -f Sender -subject "Subject Here" -server SMTPSERVER -port SMTP Port -try Number of tries



This works for me. Note the single "-" - that was the trick that got it working for me.