Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


These support forums are now closed for new topics and comments.
Please head on over to http://eureka.ucommerce.net/ for support.

  • Lars Davidsen 2 posts 22 karma points
    Mar 16, 2013 @ 00:17
    Lars Davidsen
    0

    Problem sending mails with UCommerce

    First ill say that I know that this topic has been brough up severel times before. Unfortunately they didn't solve my problem though.

    I'm trying to send a simple order confirmation e-mail.

    This goes well locally but not when I upload the code to my site.

    My smtp-settings look like this:

     

    <smtp> <network port="587" host="asmtp.unoeuro.com" userName="kontakt@*****.dk" password="****" /></smtp>

    And the code for sending the e-mail look like this:
    I am aware that my customerId is hardcoded, I don't know if that makes a difference.

    var emailService = UCommerce.Infrastructure.ObjectFactory.Instance.Resolve(); var localizationContext = UCommerce.Infrastructure.ObjectFactory.Instance.Resolve(); // Find the relevant e-mail profile for the current store var emailProfile = UCommerce.Runtime.SiteContext.Current.CatalogContext.CurrentCatalogGroup.EmailProfile; // Load information for e-mail personalization var purchaseOrder = UCommerce.Runtime.SiteContext.Current.OrderContext.GetBasket().PurchaseOrder; // Set up personalization parameters - params will be passed to // the configured e-mail template var queryStringParameters = new Dictionary(); queryStringParameters.Add("orderGuid", purchaseOrder.OrderGuid.ToString()); //queryStringParameters.Add("customerId", purchaseOrder.Customer.CustomerId.ToString()); queryStringParameters.Add("customerId", "0"); // Send e-mail

    emailService.Send(localizationContext, emailProfile, "OrderConfirmation", new System.Net.Mail.MailAddress(purchaseOrder.BillingAddress.EmailAddress), queryStringParameters);

    The strange thing is that is is different on the server than when I run it locally.

  • Lars Davidsen 2 posts 22 karma points
    Mar 16, 2013 @ 00:22
    Lars Davidsen
    0

    I forgot to say that the error happens when it is trying to run Confirmation.cshtml, and that local and server share the same Database.

    Error loading Razor Script uCommerce/Confirmation.cshtml

Please Sign in or register to post replies

Write your reply to:

Draft