Search The ForumSearch   RegisterRegister  LoginLogin

MailBee.NET Objects

 AfterLogic Forum : MailBee.NET Objects
Subject Topic: HTML Email Error on LoadBodyText Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
DonGreen
Newbie
Newbie


Joined: 20 July 2012
Location: Australia
Online Status: Offline
Posts: 1
Posted: 20 July 2012 at 11:44pm | IP Logged Quote DonGreen

Hi

I am getting the error "Argument value is invalid. InnerException message follows: URI formats are not supported." when I try and execute the following lne of code, to generate a HTML email from a dynamic web page (it has to be dynamic, to put different content in each email, dpending on my property_id (pid=5))

Argument value is invalid. InnerException message follows: URI formats are not supported.

oMailer.Message.LoadBodyText(@"http://localhost:51891/SHA_Local/my_dynamic_email_page.aspx?pid=5", MessageBodyType.Html, Encoding.Default, ImportBodyOptions.ImportRelatedFiles);

At the moment this is running from Visual Studio 2010, but will run eventually from my live erbsite, the the URL will be more like http://scholidays.com.au/mydynamic_email_page.aspx?pid=5

Can this be done?
Back to Top View DonGreen's Profile Search for other posts by DonGreen
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6104
Posted: 21 July 2012 at 1:52am | IP Logged Quote Igor

Yes, that's possible. To achieve that, you need to supply ImportBodyOptions.PathIsUri additionally to ImportBodyOptions.ImportRelatedFiles:

Code:
oMailer.Message.LoadBodyText(@"http://localhost:51891/SHA_Local/my_dynamic_email_page.aspx?pid=5", MessageBodyType.Html, Encoding.Default, ImportBodyOptions.ImportRelatedFiles | ImportBodyOptions.PathIsUri);


Without that, it is assumed that disk file path is supplied.

--
Regards,
Igor, AfterLogic Support
Back to Top View Igor's Profile Search for other posts by Igor
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump

Powered by Web Wiz Forums version 7.9
Copyright ©2001-2004 Web Wiz Guide