LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

smtp email with multiple attachments

Hi all,
 
I have searched for help with this VI, but can't really find any.  I am trying to write a VI that will send emails with attachments, and I want it to be able to be able to do more than a single file.  I believe the problem is that I don't know how to populate the clusters going to the "Attachments" array.  I do not believe that I need to populate "Data" if I supply a path.  How do I know if "Binary" should be true or false?  How do I set the value "MIME content type", and how do I know what type to set?  The following is the error message that I am getting.
 
 Error 16500 occurred at 500 Command unknown: 'MIME-VERSION:'  Possible reason(s):
LabVIEW:  (Hex 0x4074) 500 Syntax error, command unrecognized. For example, the command line might be too long.
 
Thanks for any assistance.
Jim
Jim

LV 2020
0 Kudos
Message 1 of 3
(3,108 Views)
Jim,

I'd say the odds are good that your problem is the mail server input string, not the attachments array.  For example, I now live in Tampa and can send mail successfully when I use the address of my current ISP's SMTP server (smtp-server.tampa.rr.com).  But when I try the server I previously used in Texas (smtp-server.austin.rr.com), I get the exact same error that you reported.  A more explicit error message would make troubleshooting easier, but the basic problem is that I'm trying to use an SMTP server that I no longer have access to (based on the IP address my ISP has assigned to me, presumably).

You can test this theory by configuring Outlook Express or Thunderbird or some other e-mail client to use the same outgoing SMTP server that you're trying to use in LabVIEW.  If you can't send mail that way, it confirms that your mail server string is bad.

Then again, maybe the problem is that your SMTP server requires authentication, which isn't supported by the LabVIEW SMTP VIs.  If that's the case, I recommend using the OpenG ogic-smtp library, which I have successfully used with an SMTP server that requires authentication.  You might try that library regardless, if you continue to have problems with the native SMTP VIs.

Good luck,
John


0 Kudos
Message 2 of 3
(3,097 Views)
Hi John,
 
Thanks for the response.  Also thank you for the OpenG link.  Looks like some good stuff there.  I'm not sure what I did, but it has started working.  I had used the server string previously with the "SMTP Email Send Message" VI, so that wasn't it.  I just played around with the attachment cluster elements and it started working.  If you have any insight as to what the settings for the mime-type and binary elements for various file types I would love to hear it.
 
Thanks again.
Jim
Jim

LV 2020
0 Kudos
Message 3 of 3
(3,066 Views)