tags:

views:

1806

answers:

3

I try to send a mail with an attachment with blat (with the Shell command of Access VBA).

All works fine while I try to send a .txt file

blat ... -attach c:\mydir\myfile.txt

but if I try to send a .pdf file, with the same command

blat ... -attach c:\mydir\myfile.pdf

I don't receive the mail.

Thanks in advance for any suggestions.

+1  A: 

The file type by itself shouldn't matter with BLAT, but your email provider might be balking at the size of PDF you're trying to send, or may restrict sending PDF files altogether.

I'd say check with the mail provider and see if they have any such restrictions. Meanwhile you could rename the PDF to text and ask the recipient to rename it back to PDF, but that would be a wonky and hopefully short-term workaround.

Darth Continent
I try to send a mail with attacment with a .NET application (System.Net.Mail) with the same provider and the mail come without problem.
Davide
A: 

that should work. do you have spaces in the file name or directories?

c:\test\my file.pdf
Keng
Initially I supposed this kind of problem but the path is without space.
Davide
A: 

Take a look at the file name 'length'; I just had a process fail with a text file cuz the NAME was too long.

Failed:

ar_snP_shot.txt

Succeed:

ar_snP.txt

Also use the command line 'debug' option to see whats going on. What does your log say btw?

Keng
In my test file name length not failed. However after a lot of test I solved the problem using the following command line: [C:\blat262\full\blat.exe - -s "Test mail from access" -t [email protected] -f [email protected] -server mailserver.com -body "TEST" -attach "c:\DDT_81036 DDT_81036 DDT_81036.pdf"] As you can see file name is long and with spaces; probably in my previous test I make some syntax mystake (eg. the file name between quotation marks).Thanks for support
Davide
@Davide just came accross this one. Did I solve this one? If so, can you mark my answer? Thanks.
Keng