Home Search Member List Faq Register Login  
UltimateEmail
Re: mail merage and multi-part email body

Thread Starter: gwheeloc   Started: 11-21-2007 5:12 PM   Replies: 3
 Karamasoft Support Forums » General Discussions » UltimateEmail » Re: mail merage and multi-part email body
 Printable Version    « Previous Thread   Next Thread »
  21 Nov 2007, 5:12 PM
gwheeloc is not online. Last active: 4/5/2010 9:05:41 AM gwheeloc

Top 10 Posts
Joined on 10-31-2007
Posts 36
mail merage and multi-part email body

I asked this question a while ago:

"Hi,  I have a question regarding the UltimateEmail product.  Does it support mult-part email bodies?  We have email that we would want to send containing both a text version of it and an HTML version of the same email body."

The response I received was:

You can create multi-part email bodies in .NET 2.0. Please take a look at http://msdn2.microsoft.com/en-us/library/system.net.mail.aspx to see the AlternativeView class. Please also take a look at the CustomizeMailMessage sample at http://www.karamasoft.com/Samples.aspx?component=UltimateEmail&sample=CustomizeMailMessage.

You should customize MailMessage as in the following code snippet:


MailMessage mm = new MailMessage();// Create the TEXT versionAlternateView textView = AlternateView.CreateAlternateViewFromString("Text Content", null, "text/plain");// Create the HTML versionAlternateView htmlView = AlternateView.CreateAlternateViewFromString("<b>HTML Content</b>", null, "text/html");mm.AlternateViews.Add(textView);mm.AlternateViews.Add(htmlView);
 


Is it possible to execute the Mail Merge process against these two alternate views?

thanks,
gwheeloc


  
  21 Nov 2007, 5:39 PM
Karamasoft is not online. Last active: 5/8/2018 10:36:45 AM Karamasoft

Top 10 Posts
Joined on 09-05-2004
Posts 6,820
Re: mail merage and multi-part email body
If you take a look at the MailMerge sample at http://www.karamasoft.com/Samples.aspx?component=UltimateEditor&sample=MailMerge you will see that it creates a MailMessage and customizes it. You can do the same thing before calling UltimateEmailMerge1.SendMailMerge(null, mm); at the end.
  
  26 Nov 2007, 3:07 PM
gwheeloc is not online. Last active: 4/5/2010 9:05:41 AM gwheeloc

Top 10 Posts
Joined on 10-31-2007
Posts 36
Re: mail merage and multi-part email body
no luck.  The UE email body seems to be disregarded after I add the new altenateviews. no mail merge takes place on the alternate views.

Let me ask the question another way.

Can an "UltimateEmail" email body template be applied to multiple Alternate views to accomplish multi-part email body or can the mailmerge functionality process alternate views?

Here is a sample of what I'm trying to do.

System.Net.Mail.MailMessage mm = new System.Net.Mail.MailMessage();

string sMailBody = GetMailBody("c:\TXT_mailbody.txt");
uem.BodyTemplate = sMailBody;

AlternateView textView = AlternateView.CreateAlternateViewFromString(sMailBody, null, "text/plain");

sMailBody = GetMailBody("c:\HMTL_mailbody.txt");

AlternateView htmlView = AlternateView.CreateAlternateViewFromString(sMailBody, null, "text/html");

mm.AlternateViews.Add(textView);
mm.AlternateViews.Add(htmlView);
uem.SendMailMerge(null,mm);

Thank you.
gwheeloc


  
  27 Nov 2007, 12:18 AM
Karamasoft is not online. Last active: 5/8/2018 10:36:45 AM Karamasoft

Top 10 Posts
Joined on 09-05-2004
Posts 6,820
Re: mail merage and multi-part email body
You're right. It doesn't seem to apply the template replacements to the Alternate views. However, you should delete the following line since BodyTemplate shuld not be set when you customize the mail message with the use of your own MailMessage object:

Delete line: uem.BodyTemplate = sMailBody;

We will let you know as soon as we fix this issue.

  
 Page 1 of 1 (4 items)
Karamasoft Support Forums » General Discussions » UltimateEmail » Re: mail merage and multi-part email body

You can add attachments
You can post new topics
You can reply to topics
You can delete your posts
You can edit your posts
You can create polls
You can vote in polls
Forum statistics are enabled
Forum is unmoderated

© 2002-2020 Karamasoft LLC. All rights reserved.