SendEmail causing issue with domains implementing DMARC

3 posts, 0 answers
  1. Todd A
    Todd A avatar
    43 posts
    Member since:
    Sep 2009

    Posted 07 Sep 2014 Link to this post


    The popup send email dialog asks for a From Address.  And if the sent from address is different, the email is composed with a "on behalf of".  Unfortunately this is causing blocked emails, in particular when the From Address is from AOL and Yahoo.  

    AOL and Yahoo have implemented dmarc which prevents sending on behalf of emails.
    http://www.dmarc.org/

    So ideally, the From address collected on the input page would be the reply to address (not on behalf of).   Is there some way to resolve this/override it?  or is an improvement in the works?

    Thanks,
    Todd.
  2. Danail Vasilev
    Admin
    Danail Vasilev avatar
    1490 posts

    Posted 10 Sep 2014 Link to this post

    Hi Todd,

    RadSocialShare uses the System.Net.Mail namespace and the following code for sending messages:
    C#:
    private void SendMail(string from, string to, string subject, string body)
    {
        MailMessage mail = new MailMessage();
        mail.IsBodyHtml = true;
        mail.From = new MailAddress(from);
        mail.Sender = new MailAddress(_emailSettings.FromEmail);
        string[] recepients = to.Split(',', ';');
        //check if empty - in case of additional , or ;
        foreach (string recepient in recepients) if (recepient != string.Empty) mail.To.Add(new MailAddress(recepient));
        mail.Subject = subject;
        mail.Body = body;
        string smtpServer = EmailSettings.SMTPServer;
        SmtpClient smtp = smtpServer != String.Empty ? new SmtpClient(smtpServer) : new SmtpClient();
        if (EmailSettings.UserName != String.Empty && EmailSettings.Password != string.Empty) smtp.Credentials = new System.Net.NetworkCredential(EmailSettings.UserName, EmailSettings.Password);
        else smtp.UseDefaultCredentials = true;
        //smtp.Credentials = new System.Net.NetworkCredential();
        smtp.DeliveryMethod = SmtpDeliveryMethod.Network;
        smtp.Send(mail);
     
    }

    Generally the sender is the actual originator of the mail while the from address is simply a part of the header. Therefore I am not sure whether this part of the header can be removed. More information on the matter is available in this forum thread.

    You may also find useful this feature request.

    Regards,
    Danail Vasilev
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Todd A
    Todd A avatar
    43 posts
    Member since:
    Sep 2009

    Posted 10 Sep 2014 in reply to Danail Vasilev Link to this post

    Yeah, for years the Sender worked just like it was suppose too.  Until this year when yahoo.com followed by aol.com introduced DMARC.  Unfortunately DMARC looks at the From property and ignores the Sender.  In the future, it would be nice to have more control over the mail settings.  For now, I will need to disable that functionality.


    Thanks,
    Todd.

Back to Top