[Mono-dev] MailDefinition patch

Dumitru Ban dban at dako.ro
Tue May 29 04:14:18 EDT 2007


Hi,

I'm trying to create a patch for the MailDefinition (System.Web.UI.WebControls) and I'm not sure what's the best way to do it. The problem is in the CreateMailMessage (string recipients, IDictionary replacements, Control owner) method. If the BodyFileName is present and it's rooted everything works fine. If it's not rooted, it is combined with the owner's TemplateSourceDirectory. And this is not working :(

I'm using the MailDefinition from a CreateUserWizard. Both the aspx containing the CreateUserWizard and the mail file are in the same directory, "users". If I set the BodyFileName for the wizard to "~/users/createaccount.txt", the combined path is something like this: "/myapp/~/users/createaccount.txt". And this is because there's no check for "~/".

If I set the BodyFileName to "createaccount.txt", the combined path is something like this: "/myapp/users/createaccount.txt". This one looks fine, except that it's a virtual path and the StreamReader in the CreateMailMessage is looking for a physical path.

How should be the mail file accessed? Using virtual paths or physical paths? Also, what about the permissions of the mail file?

P.S. Attached is a sample error.

Thanks & best regards,
Dumi.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20070529/07818203/attachment.html 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: maildefinition.txt
Url: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20070529/07818203/attachment.txt 


More information about the Mono-devel-list mailing list