Email errors in 1.4

Topics: Troubleshooting
Mar 8, 2012 at 6:02 AM

I can't seem to send any email out of my site...using the oforms module or within my custom module after upgrading to 1.4. The error showing in the logs is

2012-03-07 21:50:32 - ,857 [46] Orchard.Messaging.Services.DefaultMessageManager - An error occur...
,857 [46] Orchard.Messaging.Services.DefaultMessageManager - An error occured while sending the message OForm_Form_Result System.InvalidOperationException: The SMTP host was not specified. at System.Net.Mail.SmtpClient.CheckHostAndPort() at System.Net.Mail.SmtpClient.get_ServicePoint() at System.Net.Mail.SmtpClient.Dispose(Boolean disposing) at System.Net.Mail.SmtpClient.Dispose() at Orchard.Email.Services.EmailMessagingChannel.SendMessage(MessageContext context) at Orchard.Messaging.Services.DefaultMessageManager.PrepareAndSend(String type, Dictionary`2 properties, MessageContext context) in c:\Users\sebros\My Projects\Orchard\src\Orchard\Messaging\Services\DefaultMessageManager.cs:line 85 at Orchard.Messaging.Services.DefaultMessageManager.Send(IEnumerable`1 recipients, String type, String service, Dictionary`2 properties) in c:\Users\sebros\My Projects\Orchard\src\Orchard\Messaging\Services\DefaultMessageManager.cs:line 40

I haven't changed my SMTP settings...I went and resubmitted my email settings to make sure they were in there and still got the same error message. With the upgrade, do I need to change anything about the way I send emails?

Any ideas on what might be going on?

Mar 8, 2012 at 6:14 AM

Looks like I'm getting the following error when attempting to update SMTP settings as well

2012-03-07 22:11:16 - ,863 [58] Orchard.ContentManagement.Drivers.Coordinators.ContentPartDriverC...
,863 [58] Orchard.ContentManagement.Drivers.Coordinators.ContentPartDriverCoordinator - ArgumentException thrown from IContentPartDriver by Orchard.Email.Drivers.SmtpSettingsPartDriver System.ArgumentException: Value does not fall within the expected range. at Orchard.Security.Providers.DefaultEncryptionService.Decode(Byte[] encodedData) in c:\Users\sebros\My Projects\Orchard\src\Orchard\Security\Providers\DefaultEncryptionService.cs:line 33 at Orchard.Email.Handlers.SmtpSettingsPartHandler.<>c__DisplayClass2.b__0() at Orchard.ContentManagement.Utilities.ComputedField`1.GetValue() in c:\Users\sebros\My Projects\Orchard\src\Orchard\ContentManagement\Utilities\ComputedField.cs:line 22 at Orchard.Email.Drivers.SmtpSettingsPartDriver.<>c__DisplayClass8.b__7() at Orchard.ContentManagement.Drivers.ContentPartDriver`1.<>c__DisplayClassd.b__c(BuildShapeContext ctx) in c:\Users\sebros\My Projects\Orchard\src\Orchard\ContentManagement\Drivers\ContentPartDriver.cs:line 108 at Orchard.ContentManagement.Drivers.ContentPartDriver`1.<>c__DisplayClass13.b__12(BuildShapeContext ctx) in c:\Users\sebros\My Projects\Orchard\src\Orchard\ContentManagement\Drivers\ContentPartDriver.cs:line 116 at Orchard.ContentManagement.Drivers.ContentShapeResult.ApplyImplementation(BuildShapeContext context, String displayType) in c:\Users\sebros\My Projects\Orchard\src\Orchard\ContentManagement\Drivers\ContentShapeResult.cs:line 37 at Orchard.ContentManagement.Drivers.ContentShapeResult.Apply(BuildEditorContext context) in c:\Users\sebros\My Projects\Orchard\src\Orchard\ContentManagement\Driv
if I make a change to the Settings for Email, it's not keeping those changes either.

Coordinator
Mar 8, 2012 at 6:25 AM

Can you please file a bug? We're going to make a 1.4.1 release soon, and if this is reproducible it would qualify.

Mar 8, 2012 at 5:00 PM

I removed the Email module and it's database table along with the row for this module in the DataMigrations table and re-installed the module. Everything is working fine after that.

Clean installs of 1.4 work fine and another site that I upgraded to 1.4 is also working fine, so I'm not sure I can reproduce it. Just may have been something weird on the one site.

Mar 15, 2012 at 6:44 PM

There is a change in the MessageContext class. The Module.txt of the oForms module states it's targeted for Orchard 1.3.

I managed to get it working by altering line 32 of OFormMessagesAlteration.cs of the oForms module.

var form = _contentManager.Get<OFormPart>(context.Recipients.Single().Id);

I've contacted the developer(s) of oForms about this.

Apr 12, 2012 at 6:23 AM

I am working with a clean install of 1.4 and my emails aren't working either. I've tried uninstalling and reinstalling the modules to no avail; different SMTP servers etc. This was my latest error:

2012-04-12 14:58:54,152 [50] Orchard.Email.Services.EmailMessagingChannel - An unexpected error while sending a message to admin@eagles.org.au: ORCHARD_USERS_RESETPASSWORDSystem.Net.Mail.SmtpException: Failure sending mail. ---> System.FormatException: Smtp server returned an invalid response.� �at System.Net.Mail.SmtpReplyReaderFactory.ProcessRead(Byte[] buffer, Int32 offset, Int32 read, Boolean readLine)� �at System.Net.Mail.SmtpReplyReaderFactory.ReadLines(SmtpReplyReader caller, Boolean oneLine)� �at System.Net.Mail.SmtpReplyReaderFactory.ReadLine(SmtpReplyReader caller)� �at System.Net.Mail.CheckCommand.Send(SmtpConnection conn, String& response)� �at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, SmtpFailedRecipientException& exception)� �at System.Net.Mail.SmtpClient.Send(MailMessage message)� �--- End of inner exception stack trace ---� �at System.Net.Mail.SmtpClient.Send(MailMessage message)� �at Orchard.Email.Services.EmailMessagingChannel.SendMessage(MessageContext context)2012-04-12 15:03:39,035 [76] Orchard.Email.Services.EmailMessagingChannel - An unexpected error while sending a message to admin@eagles.org.au: ORCHARD_USERS_RESETPASSWORDSystem.Net.Mail.SmtpException: Failure sending mail. ---> System.FormatException: Smtp server returned an invalid response.� �at System.Net.Mail.SmtpReplyReaderFactory.ProcessRead(Byte[] buffer, Int32 offset, Int32 read, Boolean readLine)� �at System.Net.Mail.SmtpReplyReaderFactory.ReadLines(SmtpReplyReader caller, Boolean oneLine)� �at System.Net.Mail.SmtpReplyReaderFactory.ReadLine(SmtpReplyReader caller)� �at System.Net.Mail.CheckCommand.Send(SmtpConnection conn, String& response)� �at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, SmtpFailedRecipientException& exception)� �at System.Net.Mail.SmtpClient.Send(MailMessage message)� �--- End of inner exception stack trace ---� �at System.Net.Mail.SmtpClient.Send(MailMessage message)� �at Orchard.Email.Services.EmailMessagingChannel.SendMessage(MessageContext context)