on 2010 Oct 01 6:28 PM
I am trying to send an email from the server with an attachment using the system stored procedures xp_startsmtp and xp_sendmail.
begin
call xp_startsmtp(
smtp_sender = 'validsender@sendingdomain.com',
smtp_server = 'smtp.sendingdomain.com',
smtp_sender_name = 'SQL DB MSG');
call xp_sendmail(
recipient = 'validemail@validdomain.com',
subject = 'Hey Matt',
"message" = 'Just Checking in on you',
include_file = 'c:\\\\Test.txt');
end
This works when Test.txt is under a certain length like this:
abcdefghijklmno
abcdefghijk
test1
test2
test3
tes
This is either 44 characters or 49 characters depending on whether you count the new lines as characters.
Add one character to the above though to make either 45 or 50 respectively like this:
abcdefghijklmno
abcdefghijk
test1
test2
test3
test
and the message does not go through.
On a single line this works at 54 characters:
abcdefghijklmnoabcdefghijktest1test2test3test4test5tes
but this fails at 55
abcdefghijklmnoabcdefghijktest1test2test3test4test5test
Using a packet sniffer I can see the SMTP conversation and the server is responding with this:
Response: 451 see http://pobox.com/~djb/docs/smtplf.html
The website basically says that some mailers put LF at the end of lines (specifically mentioning the mailer "sendmail v8" doing this with long lines) instead of CR LF and that causes problems down the line.
The xp_sendmail procedure calls another procedure that calls a .dll, which I assume packages and sends the message with the attachment. Because it uses the .dll I do not think I can adjust the output manually by adding some CR 's somewhere.
So, is this a bug? Should I handle this differently?
Using 11.0.1.2436
Our base64 encoding did not conform exactly to the MIME standard. Most mail servers are flexible enough to accept it anyway, but the mail server Matt is using is very strict about it and will not accept our encoded data. I am in the process of fixing this and I will update this answer once I know what builds will contain the fix.
This is fixed in 10.0.1.4131, 11.0.1.2505, and 12.0.0.2594.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
...and let us know if that helped.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
66 | |
11 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.