Re: What's wrong with this BLAT string?
William Sanders / EFG wrote: MB - is the length of the string for the file attach too long? I ran into this several years back, and shifted to 'set defa to' with the location of the file I wanted to send out. The problem went away after that. try your test again, at least trimming the actual location (ok, change it !) to less than 30 characters. HTH- Mondo regards [Bill] Thanks...I tried that, but same error. -- Michael J. Babcock, MCP MB Software Solutions, LLC http://mbsoftwaresolutions.com http://fabmate.com Work smarter, not harder, with MBSS custom software solutions! ___ Post Messages to: ProFox@leafe.com Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED] ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Re: What's wrong with this BLAT string?
MB Software Solutions wrote: Grigore Dolghin wrote: Make sure you don't have two consecutive spaces anywhere. That would cause it to fail? Also, must I wrap directory/folder locations in quotes for scenarios where it's Documents and Settings\Mike\MyFile.txt ?? Hi MB, Not sure about the two spaces but I have a test program that I use and keep changing until it works, then paste this into my real program (see below). As my code is set up you will not get two spaces together. I used to use -f and -i together but then wanted something different with -replyto Have you got the syntax.txt that comes with the DLL? You will need to make sure paths are delimited. See the attach bit below. HTH Peter cEmailto='[EMAIL PROTECTED]' cCCto='' cBCCto='' lcResult = FAILED cEmailSubject='this is the subject of a test email' *cEmailFrom='operasystem' cEmailFrom='[EMAIL PROTECTED]' cAttach='my long file name.doc,and another long name.txt' cEmailbody='this is the body' lcFile='xtradata.dir' does not get sent * now sort out attachments as maybe more than one. cTemp1='' cTemp2='' IF !EMPTY(cAttach) IF ',' $ cAttach DO while ',' $ cAttach * get first part of string cTemp1 = SUBSTR(cAttach,1,AT(',',cAttach)-1) * add to new string cTemp2 = cTemp2 + [ -attach ] + ''+cTemp1+'' * chop this off original string cAttach = SUBSTR(cAttach,AT(',',cAttach)+1) ENDDO * do last entry cTemp2 = cTemp2 + [ -attach ] + ''+cAttach+'' cAttach = cTemp2 ELSE cAttach = [ -attach ] + ''+cAttach+'' ENDIF ENDIF lcSend = lcFile + ; IIF(EMPTY(cEmailto),'',[ -to ] + Chr(34) + AllTrim(cEmailTo) + Chr(34)) + ; IIF(EMPTY(cCCto),'',[ -cc ] + Chr(34) + AllTrim(cCCTo) + Chr(34)) + ; IIF(EMPTY(cBCCto),'',[ -bcc ] + Chr(34) + AllTrim(cBCCTo) + Chr(34)) + ; [ -subject ] + Chr(34) + AllTrim(cEmailSubject) + Chr(34) + ; [ -f [EMAIL PROTECTED] + ; [ -replyto ] + Chr(34) + AllTrim(cEmailFrom) + Chr(34) + ; [ -server 192.168.0.9] + ; [ -body ] + Chr(34) + AllTrim(cEmailBody) + Chr(34) + ; [ -u ] + Chr(34) + myusername + Chr(34) + ; [ -pw ] + Chr(34) + mypassword + Chr(34) + ; cAttach Declare Integer Send In system\blat.DLL STRING blatstring lcSendCmd = Send(lcSend) If lcSendCmd == 0 WAIT WINDOW Success ELSE WAIT WINDOW Failed to Send ENDIF ___ Post Messages to: ProFox@leafe.com Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED] ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Re: What's wrong with this BLAT string?
On 5/26/07, Grigore Dolghin [EMAIL PROTECTED] wrote: Make sure you don't have two consecutive spaces anywhere. This might be a good time to remind everyone about SET LIBRARY TO (HOME(1) + foxtools) ? Reduce(A B) A B ___ Post Messages to: ProFox@leafe.com Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED] ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Re: What's wrong with this BLAT string?
Yes, I'm sure about this - two consecutive spaces will cause the dll to fail. And you're right about C:\Program Files - it should be enclosed in quotes otherwise dll will fail. It expects the string in this form: -option[space]value[space]-option[space] and so on. C:\Program would be considered a value, the follows a space, then Files, which is not a valid option, so... it will fail. - Original Message - From: MB Software Solutions [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, May 30, 2007 4:10 PM Subject: Re: What's wrong with this BLAT string? Grigore Dolghin wrote: Make sure you don't have two consecutive spaces anywhere. That would cause it to fail? Also, must I wrap directory/folder locations in quotes for scenarios where it's Documents and Settings\Mike\MyFile.txt ?? -- Michael J. Babcock, MCP MB Software Solutions, LLC http://mbsoftwaresolutions.com http://fabmate.com Work smarter, not harder, with MBSS custom software solutions! [excessive quoting removed by server] ___ Post Messages to: ProFox@leafe.com Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED] ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Re: What's wrong with this BLAT string?
Garrett Fitzgerald wrote: On 5/26/07, Grigore Dolghin [EMAIL PROTECTED] wrote: Make sure you don't have two consecutive spaces anywhere. This might be a good time to remind everyone about SET LIBRARY TO (HOME(1) + foxtools) ? Reduce(A B) A B Thanks for that. Never seen that before so might find it useful. Peter ___ Post Messages to: ProFox@leafe.com Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED] ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Re: What's wrong with this BLAT string?
Hi again :) Here's a piece of code I wrote for a customer. It receives some parameters (self explanatory) and sends the mail. In my scenario there was only one attachment at most. If you need to add multiple attachments you may need to call the piece of code that starts with *-- get the attachment's short name multiple times, but it's up to you. All I can tell is this routine never failed on me. I hope it will do the same for you. *- Lparameters ; tcBodyText, ; tcTOEmailAddress, ; tcCCEmailAddress, ; tcSubject, ; tcAttachmentFileName, ; tcMailServer, ; tnPort, ; tcFromEmailAddress, ; tcUserName, ; tcPassword Local lcParameterString As String *-- Declare the API functions. Declare Integer Send ; In blat.dll ; String cParam Declare Integer GetShortPathNameA ; In Win32API As GetShortPathName ; String, ; String, ; Integer *-- create the parameter string variable: lcParameterString = *-- create the message body lcBodyFileName = _ + Right(Sys(2015),7) StrToFile(tcBodyText,lcBodyFileName,0) lcBodyFileName = FullPath(lcBodyFileName) *-- get the short (msdos) file name (required by blat) lcBuffer = Space(255) lnReturn = GetShortPathName(lcBodyFileName, @lcBuffer,255) lcBodyFileShortName = Left(lcBuffer,lnReturn) *-- store the shortfilename into parameter string lcParameterString = lcBodyFileShortName +careful with the spaces. One single extra space and blat fails. *-- add TO address to parameter string lcParameterString = lcParameterString + -to + tcTOEmailAddress + *-- add the CC address to parameter string If Vartype(tcCCEmailAddress) = C And Not Empty(Alltrim(tcCCEmailAddress)) lcParameterString = lcParameterString + -cc + tcCCEmailAddress + EndIf *-- add the subject to parameter string: If Vartype(tcSubject) C Or ; Empty(Alltrim(tcSubject)) tcSubject = Automated email from UPC Maintenance process EndIf lcParameterString = lcParameterString + -subject + tcSubject + *-- get the attachment's short (msdos) filename If Vartype(tcAttachmentFileName) = C And Not Empty(tcAttachmentFileName) lcBuffer = Space(255) lnReturn = GetShortPathName(tcAttachmentFileName, @lcBuffer,255) lcAttachmentFileShortName = Left(lcBuffer,lnReturn) *-- and add it to parameter string: lcParameterString = lcParameterString + -attach + lcAttachmentFileShortName + EndIf *-- get the mail server: If Vartype(tcMailServer) = C And Not Empty(tcMailServer) lcParameterString = lcParameterString + -server + Alltrim(tcMailServer) + Else ThisForm.Log(Error. Mail server not defined.) Return .F. EndIf *-- add the port to string parameter: lcParameterString = lcParameterString + -port + Transform(tnPort) + *-- add the FROM email address: lcParameterString = lcParameterString + -f + tcFromEmailAddress + *-- Add the smtp username: lcParameterString = lcParameterString + -u + tcUserName + *-- add the smtp password: lcParameterString = lcParameterString + -pw + tcPassword lnResult = Send(lcParameterString) If lnResult = 0 ThisForm.Log(Mail to + tcTOEmailAddress + was sent succesfully.) Else ThisForm.Log(Error sending email to + tcTOEmailAddress + . Error code is + Transform(lnResult)) ThisForm.Log(BLAT.DLL parameter: + lcParameterString) ThisForm.Log(If you see this error in the activity log file, please forward the report email to [EMAIL PROTECTED]) EndIf *- - Original Message - From: MB Software Solutions [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, May 30, 2007 4:10 PM Subject: Re: What's wrong with this BLAT string? Grigore Dolghin wrote: Make sure you don't have two consecutive spaces anywhere. That would cause it to fail? Also, must I wrap directory/folder locations in quotes for scenarios where it's Documents and Settings\Mike\MyFile.txt ?? -- Michael J. Babcock, MCP MB Software Solutions, LLC http://mbsoftwaresolutions.com http://fabmate.com Work smarter, not harder, with MBSS custom software solutions! [excessive quoting removed by server] ___ Post Messages to: ProFox@leafe.com Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED] ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Re: What's wrong with this BLAT string?
Peter Cushing wrote: Hi MB, Not sure about the two spaces but I have a test program that I use and keep changing until it works, then paste this into my real program (see below). As my code is set up you will not get two spaces together. I used to use -f and -i together but then wanted something different with -replyto Have you got the syntax.txt that comes with the DLL? You will need to make sure paths are delimited. See the attach bit below. HTH Peter cEmailto='[EMAIL PROTECTED]' cCCto='' cBCCto='' lcResult = FAILED cEmailSubject='this is the subject of a test email' *cEmailFrom='operasystem' cEmailFrom='[EMAIL PROTECTED]' cAttach='my long file name.doc,and another long name.txt' cEmailbody='this is the body' lcFile='xtradata.dir' does not get sent * now sort out attachments as maybe more than one. cTemp1='' cTemp2='' IF !EMPTY(cAttach) IF ',' $ cAttach DO while ',' $ cAttach * get first part of string cTemp1 = SUBSTR(cAttach,1,AT(',',cAttach)-1) * add to new string cTemp2 = cTemp2 + [ -attach ] + ''+cTemp1+'' * chop this off original string cAttach = SUBSTR(cAttach,AT(',',cAttach)+1) ENDDO * do last entry cTemp2 = cTemp2 + [ -attach ] + ''+cAttach+'' cAttach = cTemp2 ELSE cAttach = [ -attach ] + ''+cAttach+'' ENDIF ENDIF lcSend = lcFile + ; IIF(EMPTY(cEmailto),'',[ -to ] + Chr(34) + AllTrim(cEmailTo) + Chr(34)) + ; IIF(EMPTY(cCCto),'',[ -cc ] + Chr(34) + AllTrim(cCCTo) + Chr(34)) + ; IIF(EMPTY(cBCCto),'',[ -bcc ] + Chr(34) + AllTrim(cBCCTo) + Chr(34)) + ; [ -subject ] + Chr(34) + AllTrim(cEmailSubject) + Chr(34) + ; [ -f [EMAIL PROTECTED] + ; [ -replyto ] + Chr(34) + AllTrim(cEmailFrom) + Chr(34) + ; [ -server 192.168.0.9] + ; [ -body ] + Chr(34) + AllTrim(cEmailBody) + Chr(34) + ; [ -u ] + Chr(34) + myusername + Chr(34) + ; [ -pw ] + Chr(34) + mypassword + Chr(34) + ; cAttach Declare Integer Send In system\blat.DLL STRING blatstring lcSendCmd = Send(lcSend) If lcSendCmd == 0 WAIT WINDOW Success ELSE WAIT WINDOW Failed to Send ENDIF Excellent...THANK YOU! -- Michael J. Babcock, MCP MB Software Solutions, LLC http://mbsoftwaresolutions.com http://fabmate.com Work smarter, not harder, with MBSS custom software solutions! ___ Post Messages to: ProFox@leafe.com Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED] ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Re: What's wrong with this BLAT string?
Garrett Fitzgerald wrote: This might be a good time to remind everyone about SET LIBRARY TO (HOME(1) + foxtools) ? Reduce(A B) A B COOL! Never heard of that one! -- Michael J. Babcock, MCP MB Software Solutions, LLC http://mbsoftwaresolutions.com http://fabmate.com Work smarter, not harder, with MBSS custom software solutions! ___ Post Messages to: ProFox@leafe.com Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED] ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Re: What's wrong with this BLAT string?
Grigore Dolghin wrote: Hi again :) Here's a piece of code I wrote for a customer. It receives some parameters (self explanatory) and sends the mail. In my scenario there was only one attachment at most. If you need to add multiple attachments you may need to call the piece of code that starts with *-- get the attachment's short name multiple times, but it's up to you. All I can tell is this routine never failed on me. I hope it will do the same for you. I'm going to try it today...thanks to all of you for your help. Grigore--you should post that snippet on Ed's downloads page! -- Michael J. Babcock, MCP MB Software Solutions, LLC http://mbsoftwaresolutions.com http://fabmate.com Work smarter, not harder, with MBSS custom software solutions! ___ Post Messages to: ProFox@leafe.com Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED] ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Re: What's wrong with this BLAT string?
Grigore Dolghin wrote: Yes, I'm sure about this - two consecutive spaces will cause the dll to fail. And you're right about C:\Program Files - it should be enclosed in quotes otherwise dll will fail. It expects the string in this form: -option[space]value[space]-option[space] and so on. C:\Program would be considered a value, the follows a space, then Files, which is not a valid option, so... it will fail. Well, I'm still working with the snippets posted here, but I can tell you that I believe I had 2 consecutive spaces, because when I made sure it was just 1 between arguments, the email command worked fine. Thanks again!!! -- Michael J. Babcock, MCP MB Software Solutions, LLC http://mbsoftwaresolutions.com http://fabmate.com Work smarter, not harder, with MBSS custom software solutions! ___ Post Messages to: ProFox@leafe.com Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED] ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Re: What's wrong with this BLAT string?
You're more than welcome, Michael. - Original Message - From: MB Software Solutions [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, May 31, 2007 1:06 AM Subject: Re: What's wrong with this BLAT string? Grigore Dolghin wrote: Yes, I'm sure about this - two consecutive spaces will cause the dll to fail. And you're right about C:\Program Files - it should be enclosed in quotes otherwise dll will fail. It expects the string in this form: -option[space]value[space]-option[space] and so on. C:\Program would be considered a value, the follows a space, then Files, which is not a valid option, so... it will fail. Well, I'm still working with the snippets posted here, but I can tell you that I believe I had 2 consecutive spaces, because when I made sure it was just 1 between arguments, the email command worked fine. Thanks again!!! -- Michael J. Babcock, MCP MB Software Solutions, LLC http://mbsoftwaresolutions.com http://fabmate.com Work smarter, not harder, with MBSS custom software solutions! [excessive quoting removed by server] ___ Post Messages to: ProFox@leafe.com Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED] ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
RE: What's wrong with this BLAT string?
Hi Michael, It fails with a return code of 1 Are you using the DLL? Recently I had a similar problem. The DLL would return 1, but when I used BLAT.EXE with exactly the same string, it would work. Even more confusing: The call to the DLL works fine at the beginning of the main program, but fails later in the application. I haven't found out why this is happening. -- Christof ___ Post Messages to: ProFox@leafe.com Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED] ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Re: What's wrong with this BLAT string?
Off the top of my head. the user -u maybe shouldnt have the complete email address. the -u a -pw work together to allow you to use the smtp server.. Most often the user is the part of the email address before the domain I have been using blat since 1999 the blat.dll wrapper I wrote a few years ago, has never failed me.. http://www.1amsoftware.com/Downloads.htm it allow you to construct your blat command much like creating a sql statment. Its much easiser to follow that way, at least for me. Bob Lee - Original Message - From: MB Software Solutions [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, May 25, 2007 10:50 AM Subject: What's wrong with this BLAT string? Anyone see the problem with it? It fails with a return code of 1 when called: atables.txt -to [EMAIL PROTECTED] -s Data Backup as of 05/25/2007 01:40:54 PM -i [EMAIL PROTECTED] -server smtp.mbsoftwaresolutions.com -attach c:\downloads\fabmate\carfaro\data052507\backup\data1_4_671_20070525134039.zip -u [EMAIL PROTECTED] -pw mypassword -f [EMAIL PROTECTED] I'm checking other things now (like proper uid/pwd, etc.) but wondered if someone saw something obvious that I didn't. I'm using 7zip to create a backup of the data folder, then want to email it to me. -- Michael J. Babcock, MCP MB Software Solutions, LLC http://mbsoftwaresolutions.com http://fabmate.com Work smarter, not harder, with MBSS custom software solutions! [excessive quoting removed by server] ___ Post Messages to: ProFox@leafe.com Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED] ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Re: What's wrong with this BLAT string?
Make sure you don't have two consecutive spaces anywhere. - Original Message - From: MB Software Solutions [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, May 25, 2007 8:50 PM Subject: What's wrong with this BLAT string? Anyone see the problem with it? It fails with a return code of 1 when called: atables.txt -to [EMAIL PROTECTED] -s Data Backup as of 05/25/2007 01:40:54 PM -i [EMAIL PROTECTED] -server smtp.mbsoftwaresolutions.com -attach c:\downloads\fabmate\carfaro\data052507\backup\data1_4_671_20070525134039.zip -u [EMAIL PROTECTED] -pw mypassword -f [EMAIL PROTECTED] I'm checking other things now (like proper uid/pwd, etc.) but wondered if someone saw something obvious that I didn't. I'm using 7zip to create a backup of the data folder, then want to email it to me. -- Michael J. Babcock, MCP MB Software Solutions, LLC http://mbsoftwaresolutions.com http://fabmate.com Work smarter, not harder, with MBSS custom software solutions! [excessive quoting removed by server] ___ Post Messages to: ProFox@leafe.com Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED] ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.