non useful log about wrong e-mail address format

This is the place to report bugs and get support. When posting in this forum, please always provide as much detail as possible.

Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum, do not report it as a bug.

This is the place to report bugs and get support

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.
Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum.
This thread is closed to new posts. You must sign in to post in the forums.
11/28/2009 3:39:22 PM
Gravatar
Total Posts 18439

Re: non useful log about wrong e-mail address format

Does mojoPortal support HTML mails that have fallback plain text currently? (as AlternateViews [MIME/Multipart])

No, since that is not supported directly/easily on the .NET classes (as far as I know). DotNetOpenMail had that which was one of the things that attracted me to it originally. 

If you feel you can implement this as well it would be welcome help!

Best,

Joe

11/28/2009 3:43:30 PM
Gravatar
Total Posts 116
http://www.zoomicon.com http://birbilis.spaces.live.com http://www.delicious.com/birbilis http://twitter.com/Zoomicon

Re: non useful log about wrong e-mail address format

at

http://community.discountasp.net/showthread.php?t=3762

there's a useful discussion that shows one can have a message with just a text/plain AlternateView, so they can set TransferEncoding there (modified their sample a bit since they were instantiating SmtpClient class twice by accident)

MailMessage email = new MailMessage(SENDER_EMAIL, RECIPIENT_EMAIL);

email.Subject = SUBJECT;

AlternateView plainView = AlternateView.CreateAlternateViewFromString(sMessageBody, Nothing, "text/plain");

plainView.TransferEncoding = System.Net.Mime.TransferEncoding.SevenBit;

email.AlternateViews.Add(plainView);

SmtpClient _client;

this._client = new SmtpClient(SMTP_SERVER, 25);

this._client.Credentials = new NetworkCredential(CRED_ID, CRED_LOGIN);

this._client.Timeout = TIMEOUT;

this._client.Send(email);



11/28/2009 3:48:21 PM
Gravatar
Total Posts 18439

Re: non useful log about wrong e-mail address format

Well that looks easy enough ;-) and will be very useful.

11/28/2009 3:48:58 PM
Gravatar
Total Posts 116
http://www.zoomicon.com http://birbilis.spaces.live.com http://www.delicious.com/birbilis http://twitter.com/Zoomicon

Re: non useful log about wrong e-mail address format

There's a CreateAlternateViewFromString that takes an encoding param (the example I used above had Nothing for the encoding)

http://msdn.microsoft.com/en-us/library/ms144596.aspx

so one can add an AlternateView of "text/plain" with the encoding the user asked and then tell it to use "base64" TransferEncoding (in the example I copy/pasted above they were using 7-bit)

----

Also in the same way can add more AlternateViews for HTML mimetype ("text/html" I think is the MIME type, but better check it out). For HTML with no images/attachments (just formatted text) it's easy to add with few changes I suppose

11/28/2009 3:52:31 PM
Gravatar
Total Posts 116
http://www.zoomicon.com http://birbilis.spaces.live.com http://www.delicious.com/birbilis http://twitter.com/Zoomicon

Re: non useful log about wrong e-mail address format

regarding the SubjectEncoding you just do as before I suppose, set the appropriate property of the MailMessage class (the AlternateViews are for the content, not the header)

11/29/2009 7:05:50 AM
Gravatar
Total Posts 18439

Re: non useful log about wrong e-mail address format

My changes from yesterday are now in svn trunk so you can proceed with the improvements you want to work on. The relevant code is in the mojoPortal.Net project Email.cs.

If you add support for a from address display name to be passed in you should create a new overload.

Currently there are methods named SendEmail which use the DotNetOpenMail library and SendEmailNormal which use the System.Net classes.

Ultimately once everything is working and tested using various encodings I will move the system.net logic into the SendEmail methods and deprecate the SendEmailNormal methods and remove references to DotNetOpenMail.

Once you have completed your enhancements for encodings and display name and they have been tested thoroughly, then I will do the work to add a setting in the WebStore for the email display name and I will also add it as a site setting so it can be used more generally in other site emails.

You can create an svn patch and send it to me when you are finished.

Thanks for your help with this!

Best,

Joe

You must sign in to post in the forums. This thread is closed to new posts.