aspNetEmail

EmailMessage.SendMailMergeToMSPickup Method (DataView, String)

Performs a MailMerge using a DataView

public bool SendMailMergeToMSPickup(
   DataView dataView,
   string MSPickupDirectoryPath
);

Parameters

dataView
DataView containing the mail merge data.
MSPickupDirectoryPath
The SMTP Service pickup directory path.

Return Value

True if the mail merge was successful.

Example

[C#]
            EmailMessage msg = new EmailMessage( );
            msg.FromAddress = "me@myCompany.com";
            msg.To = "##Email_Address##";
            msg.Subject = "Order Confirmation";
            msg.Body = "Hi ##fldFirstName##\r\n Here is your invoice and order confirmation...";
            
            //logging for easier troubleshooting
            msg.Logging = true;
            msg.LogPath = "c:\\email.log";
            
            
            //get the DefaultViewfor the mail merge
            DataView dv = GetDataView(); //a method that returns a DataView that has the columns "Email_Address" and "fldFirstName"
            
            
            msg.SendMailMergeToMSPickup( dv, "c:\\inetpub\\mailroot\\pickup" );
            
            
[VB.NET]
            
            Dim msg As New EmailMessage()
            
            msg.FromAddress = "me@myCompany.com"
            msg.To = "##Email_Address##"
            msg.Subject = "Order Confirmation"
            msg.Body = "Hi ##fldFirstName##" + ControlChars.Cr + ControlChars.Lf + " Here is your invoice and order confirmation..."
            
            'logging for easier troubleshooting
            msg.Logging = True
            msg.LogPath = "c:\email.log"
            
            
            'get the DefaultViewfor the mail merge
            Dim dv As DataView = GetDataView() 'a method that returns a DataView that has the columns "Email_Address" and "fldFirstName"
            
            msg.SendMailMergeToMSPickup(dv, "c:\inetpub\mailroot\pickup")
            
            

See Also

EmailMessage Class | aspNetEmail Namespace | EmailMessage.SendMailMergeToMSPickup Overload List