| Author |  | 
      
        | DonGreen Newbie
 
  
 
 Joined: 20 July 2012
 Location: Australia
 Online Status: Offline
 Posts: 1
 | 
          Hi
           | Posted: 20 July 2012 at 11:44pm | IP Logged |   |  
           | 
 |  
 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 |     | 
       
       
        |  | 
        | Igor AfterLogic Support
 
  
 
 Joined: 24 June 2008
 Location: United States
 Online Status: Offline
 Posts: 6168
 | 
          Yes, that's possible. To achieve that, you need to supply ImportBodyOptions.PathIsUri additionally to ImportBodyOptions.ImportRelatedFiles:
           | Posted: 21 July 2012 at 1:52am | IP Logged |   |  
           | 
 |  
 
 
| 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 |     | 
       
       
        |  |