Developer forum

Forum » Development » EmailSender Send not sending

EmailSender Send not sending

Jonas Mersholm
Reply

I'm using the following code to send a mail. No exception is raised, the boolean returns true, but there is no mail log added even though the parameter is added. The email is not sent but does not return any errors. Any ideas?

 

I've tried to output the razor template, and it contains no errors at all. Pure html.

 

Best regards Jonas

                    System.Net.Mail.MailMessage MM = new System.Net.Mail.MailMessage();
                    MM.To.Add(Owner);
                    MM.To.Add(Customer);
                    MM.From = Owner;
                    MM.IsBodyHtml = true;
                    MM.Body = Razor.Parse(template, model);                    

try
                    {
                        
                        bool s = Dynamicweb.EmailHandler.Send(MM, true, true);
                        if (s == false)
                        {
                            Response.Write("Fejl i mailudsending. Kontakt venligst Sport-Direct");
                            Response.End();
                        }
                    }
                    catch (Exception e)
                    {
                        Response.Write(e.Message);
                        Response.End();
                    }

Replies

 

You must be logged in to post in the forum