Hi,
I followed next article http://www.publicvoid.dk/SendingEmailUsingUCommerce.aspx for sending email using uCommerce. I received an error "The specified string is not in the form required for an e-mail address." I checked toAddres parameter and it's fine email address. Is there any other settings or configuration for email service that I need to set?
static void Send(string emailType, string toAddress, Dictionary<string, string> parameters){
// Get the services required for sending e-mails
var emailService = UCommerce.Infrastructure.ObjectFactory.Instance.Resolve<UCommerce.Transactions.IEmailService>();
var localizationContext = UCommerce.Infrastructure.ObjectFactory.Instance.Resolve<UCommerce.Infrastructure.Globalization.ILocalizationContext>();
// Find the relevant e-mail profile for the current store
var emailProfile = UCommerce.Runtime.SiteContext.Current.CatalogContext.CurrentCatalogGroup.EmailProfile;
System.Net.Mail.MailAddress mm = new System.Net.Mail.MailAddress(toAddress);
// Send e-mail
emailService.Send(localizationContext,
emailProfile,
emailType,
mm,
parameters);
Hi Morten,
I'm using Umbraco 6.1.6 with uCommerce 4.0.6.13304 (Demo store version 2.0.0.13249) and full stack trace is:
2014-09-03 17:14:26,662 [55] WARN umbraco.macro - [Thread 98] Error loading MacroEngine script (file: MyAccountForgottenPassword.cshtml, Type: ''. Exception: System.FormatException: The specified string is not in the form required for an e-mail address.
System.Net.Mail.MailAddressParser.ReadCfwsAndThrowIfIncomplete(String
data, Int32 index) at
System.Net.Mail.MailAddressParser.ParseDomain(String data, Int32&
index) at System.Net.Mail.MailAddressParser.ParseAddress(String
data, Boolean expectMultipleAddresses, Int32& index) at
System.Net.Mail.MailAddressParser.ParseAddress(String data) at
System.Net.Mail.MailAddress..ctor(String address, String displayName,
Encoding displayNameEncoding) at
System.Net.Mail.MailAddress..ctor(String address, String displayName)
at UCommerce.Transactions.EmailService.Send(ILocalizationContext
localizationContext, EmailProfile profile, String emailTypeName,
MailAddress to, IDictionary2 templateParameters) at
ASP.uCommerce.Functions.Email.Send(String emailType, String
toAddress, Dictionary2 parameters) in
d:\Projects\CaffeineOD\trunk\webroot\AppCode\uCommerce\Functions\Email.cshtml:line
12 at
ASP.uCommerce.Functions.Email.SendForgottenPasswordEmail(String
emailAddress) in
d:\Projects\CaffeineOD\trunk\webroot\AppCode\uCommerce\Functions\Email.cshtml:line
39 at
ASP.PagemacroScriptsMyAccountForgottenPasswordcshtml.Execute() in
d:\Projects\CaffeineOD\trunk\webroot\MacroScripts\MyAccountForgottenPassword.cshtml:line
17 at System.Web.WebPages.WebPageBase.ExecutePageHierarchy() at
System.Web.WebPages.WebPage.ExecutePageHierarchy(IEnumerable`1
executors) at System.Web.WebPages.WebPage.ExecutePageHierarchy()
at
System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext
pageContext, TextWriter writer, WebPageRenderingBase startPage) at
umbraco.MacroEngines.RazorMacroEngine.ExecuteRazor(MacroModel macro,
INode currentPage) at
umbraco.MacroEngines.RazorMacroEngine.Execute(MacroModel macro, INode
currentPage) at umbraco.macro.loadMacroScript(MacroModel macro)
at umbraco.macro.renderMacro(Hashtable pageElements, Int32 pageId)
Cannot send an email
Hi, I followed next article http://www.publicvoid.dk/SendingEmailUsingUCommerce.aspx for sending email using uCommerce. I received an error "The specified string is not in the form required for an e-mail address." I checked toAddres parameter and it's fine email address. Is there any other settings or configuration for email service that I need to set?
For SMTP I'm using gmail like this:
enableSsl="true" />
My code is next:
}
Can you send the full stack trace. What version of uCommerce are you running?
Best regards
Morten
Hi Morten, I'm using Umbraco 6.1.6 with uCommerce 4.0.6.13304 (Demo store version 2.0.0.13249) and full stack trace is:
Hello Ivan,
Please check the "Sender Name" and "Sender Email" setup for the Email Profile.
The From address is taken from the profile.
Kind regards,
Jesper
is working on a reply...