Oct 29, 2010 at 9:55 PM
Edited Oct 29, 2010 at 10:47 PM
Ben, maybe I am not understanding the settings in Settings > Email, but I found out why I've got this issue. In the file Extensions/SendCommentMail.cs, there are these two lines:
OK, I made a few code changes and now it works like I was expecting it to. I also found in admin/pages/Settings.aspx.cs the event for the "Test" button on the Setting page and the code there was:
mail.To.Add(mail.From); - no wonder when using noreply it looked like it wasn't working. I changed that to:
AuthorProfile ap = AuthorProfile.GetProfile("admin");
And in Extensions/SendCommentMail.cs, I changed the code there to:
mail.To.Add(post.AuthorProfile.EmailAddress); - So now when a comment is added to a post, the notification goes to the post author.
So that brings me to another question: When the next version comes out and I upgrade to it, will these changes be lost?
mail.From = new
This is why when I used "noreply" as the address it appeared like it didn't work. It's because the code says to make the sender and recipient the same and that address doesn't really exist! Only after one of my users (an address I tried
that appeared not to work) came to me and said "hey, what's this email all about" did I come to realize what was happening.
It seems that the address in Settings > Email should be considered the "from" address when emails are sent from the system. Why would the recipient be the same??? Shouldn't the recipient be either the post author and/or the system
admin? That's the behavior I was assuming.
The current behavior seems off to me unless I'm misunderstanding how it's supposed to work.