Using SMTP with from .net In LabVIEW Primary Software: LabVIEW Development Systems>>Professional Development SystemPrimary Software Version: 1.0 Primary Software Fixed Version: N/A Secondary Software: N/A
Problem: I found an example for sending emails through a .net Object how can I translate this example into LabVIEW? And how can I embed images in a HTML body of a mail with this? Solution: The MailMessage class represents the content of a mail message. The SmtpClient class transmits email to the SMTP host that you designate for mail delivery. You can create mail attachments using the Attachment class. For sending a message the 3 basic Objects that are required is the System.Net.Mail SMTPClient, in here you define the address and the port of the SMTP Server you will connect to. System.Net.Mail MailMessage, here you define the From: To: Subject and Body. System.Net Network Credentials. Here you define the Username and Password if required. To create any of the above Objects insert a .net constructor node, and browse to the specific class. You can find an example of this classes implemented in the SMTPSimple in the attachments sections. For creating more advance emails you can use objects like Attachments or Alternate Views. For example to create a HTML mail with images attached you have to create an Alternative View and include linked resource. In the HTML code you have to make reference to this linked resource directly. When working with Alternative Views and linked Resources its important to specify the Content Type so it can be identified correctly in the email, for example if the Alternative View is html specify the content type as text/HTML. An example of this ca be seen in the attached VI STMP.vi msdn.microsoft.com/en-us/library/system.net.mail.attachment.aspx Related Links: MSDN: System.Net.Mail Namespace Sending HTML Mail with Embedded Image in .NET Attachments:
Report Date: 05/23/2008 Last Updated: 06/26/2008 Document ID: 4LM9FQYN |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
