Page 1 of 1 1
Topic Options
#26057 - 2002-07-29 07:33 PM Blat experts
WeakLink Offline
Fresh Scripter

Registered: 2002-03-06
Posts: 37
Loc: San Diego
Hi All, I promised I'd be back!!!!

I am trying to send mail using blat, and I keep receiving the error: Failed to open registry key for Blat profile , using default. -to does not exist.

Here are all the variations I have tried:

$EmailAdd=email@@server.com
$mailserver=server.sd.server.com (fully qualified mailserver name)

shell 'cmd /c c:\temp\blat\blat.exe -to $EmailAdd -server $mailserver -subject "test from kix"'

$EmailAdd=email@@server.com
$mailserver=server.sd.server.com (fully qualified SMTPserver name)

shell 'cmd /c c:\temp\blat\blat.exe -to $EmailAdd -server $mailserver -subject "test from kix"'

shell 'cmd /c c:\temp\blat\blat.exe -to ccannon@@server.com -server xxx.xx.xx.xxx (SMTPserver) -subject "test from kix"

shell 'cmd /c c:\temp\blat\blat.exe -to $ccannon@@server.com -server $SMTPserver -subject "test from kix"'

shell 'cmd /c c:\temp\blat\blat.exe -to ccannon+"chr(64)"+server.com -server $SMTPserver -subject "test from kix"'

Top
#26058 - 2002-07-29 08:57 PM Re: Blat experts
gwgaston Offline
Fresh Scripter

Registered: 2002-02-06
Posts: 13
First arg to blat must be the name of a file to mail as the message body, or a hyphen (-) if you are using stdin or the -body switch. Blat is looking for a file named -to as you didn't follow the rules. [Smile]

Try something like:

c:\temp\blat\blat.exe - -to $EmailAdd -server $mailserver -subject "test from kix" -body "YAT" -f me@@here.com -q

Supplying a sender address (-f), along with the server address (which you have provided), is required if you don't create a default profile for blat to use i.e. with the -install switch. Even then, you will get the warning: "Failed to open registry key for Blat profile , using default.". Since you are supplying it all on the command line you can: ignore it, "install" blat, or use the -q to supress this and other messages.

Gerald W. Gaston

[ 29 July 2002, 21:41: Message edited by: gwgaston ]

Top
#26059 - 2002-07-29 09:29 PM Re: Blat experts
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Digging into this..

You will need to have a text file to send..

If you do the following, it should work fine:
code:
break on cls
$EmailAdd="user@@domain.com"
$mailserver="smtp.domain.com"
$Blatexe="C:\Batch\blat.exe"

shell '%COMSPEC% /c $Blatexe "byname.txt" -s "What are we testing" -t $EmailAdd -f $EmailAdd -server $mailserver'

get $k

Even though we see:
quote:

Failed to open registry key for Blat profile , using default.
Failed to open registry key for Blat
Sending byname.txt to user@domain.com
Subject:What are we testing
Login name is user@domain.com

HTH,

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#26060 - 2002-07-29 10:11 PM Re: Blat experts
WeakLink Offline
Fresh Scripter

Registered: 2002-03-06
Posts: 37
Loc: San Diego
Kent,

Okay so the trick is to attach a dummy file huh?? Thanks for that info and your help.

So if the blat location is the netlogon folder, I would change the
$Blatexe="C:\blat\blat.exe" to
$Blatexe="@scriptdir\netlogon\blat\blat.exe"
correct?

Top
#26061 - 2002-07-29 10:18 PM Re: Blat experts
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Yes that is correct.. What it does is use that text file for the body of the message..

HTH,

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#26062 - 2002-07-29 10:21 PM Re: Blat experts
gwgaston Offline
Fresh Scripter

Registered: 2002-02-06
Posts: 13
As previously mentioned, just use the -body switch. No need for a "dummy" file.

-Gerald

Top
#26063 - 2002-07-29 10:32 PM Re: Blat experts
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Tried that though and it seemed to fail.

I did see the -body option there.

I have tried it in various positions of the line with the same result.

I am running v1.8.9..

Thanks,

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#26064 - 2002-07-29 10:33 PM Re: Blat experts
WeakLink Offline
Fresh Scripter

Registered: 2002-03-06
Posts: 37
Loc: San Diego
Yup Gerald, that worked. Thanks guys for your help, and I'll be back soon!!!!
Top
#26065 - 2002-07-29 10:37 PM Re: Blat experts
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
OK..

Tried it again and does work..

Thanks!

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#26066 - 2002-07-29 10:44 PM Re: Blat experts
gwgaston Offline
Fresh Scripter

Registered: 2002-02-06
Posts: 13
The -body switch has been in since 1.8.4d (working correctly since 1.8.5b or so [Smile] ).

When you say it fails... Does it just spit out the usage info like a syntax error would?

blat - -t fred@bedrock.com -s YAT -body TEST

-Gerald

Top
#26067 - 2002-07-29 10:45 PM Re: Blat experts
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
No.. I figured it out..

My bad..

It seems pretty particular about order of the switches.

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 2220 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.067 seconds in which 0.031 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org