01-29-2025 12:18 PM
Hi - can anyone help?
I'm using LV2024, and the latest SMTP VIs.
With no attachments, I can send email no problem, so the server settings are definately OK. If I attach a plain text document, that will work OK too. But if I try to attach a .zip file, or a .bin file (what I really want to attach!) - I get a mysterious error:
Possible reason(s):
LabVIEW: (Hex 0x58C03) An unknown error occurred in the curl libraries.
Complete call chain:
LabVIEWSMTPClient.lvlib:Send.vi:2280002
Action.UploadByEmail.SendEmail.vi
Does anyone with more experience of SMTP than me have any ideas?
Many thanks in advance!
Jon
01-29-2025 12:22 PM
Is it possible that the email server has a restriction on certain attachment types?
01-29-2025 12:45 PM - edited 01-29-2025 12:54 PM
I didn't realise that was a thing! I'll check with the mail host.
01-29-2025 02:23 PM
As mentioned, some domains do not allow zip files. This is usually a policy of the company's I.T. department to whom you're sending the message, not a restriction imposed by the mail server itself. But this restriction can be circumvented by renaming the file extension (.zip => .z-i-p). You could try this instead.
01-29-2025 02:29 PM
If changing the extension doesn't work, it might still be filtering out zip files.
We used to rename *.zip files to *.piz, but our latest email system at work actually looks inside attachments to determine the type. So changing the extension doesn't work anymore.
01-29-2025 04:54 PM - edited 01-29-2025 05:04 PM
I tried renaming files to various things - it didn't help. The only thing I can get to send via LabVIEW is a very short bin or text file. But anything more than 55bytes causes the "curl" error described above.
With LabVIEW:
Port 465 gives a timeout whether the TLS switch is on or off
Port 587 sends fine whether the TLS switch is on or off, BUT any attachement causes the "curl" error.
With Outlook:
Port 465 using SSL/TLS encryption - works fine with and without ANY attachment.
Port 587 using "auto" encryption - works fine with and without ANY attachment.
It seems to me that LabVIEW is behaving differently to Outlook. Which suggests it's nothing to do with the mailserver at all.
I'm just using the standard "Send email using SMTP Client" example, but with the attachments VI added.
Any further thoughts, anyone?
01-31-2025 05:25 PM
I ended up giving up with the native LabVIEW VIs - they're just not working very well. And actually they're pretty limited in what they can do.
I've used SwithMail before. CC licence, and very flexible and very reliable, in my experience.
https://www.tbare.com/software/swithmail/
I've attached my VI wrapper. I've made very little effort on error handling, but it works nicely - maybe it's useful to someone.
02-01-2025 01:48 AM
Most basic SMTP functionality is going to be a no-go at this point. Most email senders, in addition to receiving servers, now try to block every means they know of for distributing malware and phishing attempts. (You know all those annoying test emails your IT probably sends out every 2-3 months? These emails look just like those to servers) I can't even attach a vipm .vip to emails anymore (because they're just ZIPs afterall)
You can sometimes get around this by using newer authentication methods (which SMTP definitely does not to) but all still run the risk of getting blocked by recipients which the sender won't know about unless they know the recipient and get told. Doubly true for mail services that don't generate errors, the receiving server might still block the email.
Welcome to the more secure modern age of web.