Send Email via asp.net width answer button

public static string Un_Email_Smart(string email_reponse, string signature, string nom_expediteur, string sujet, string contenu)

    {

        try

        {

            MailAddress from = new MailAddress(smtp_user, nom_expediteur);

            MailAddress to = new MailAddress(smtp_user);

            MailMessage mail = new MailMessage(from, to);

            mail.Bcc.Add(« contact@arcachon-communications.com »);

            mail.Subject = sujet;

            mail.Body =

                contenu+              

                    « <a style=\ »padding:5px;font-size:18px;font-weight:bold;cursor:default;background-color:Silver;color:Black;border:1px solid Black;text-decoration:none;border-radius:3px;\ »  » +

                    « href=\ »mailto: » + email_reponse + « ?subject= » + sujet +

                    « &body=… %0A%0A%0A » +

                    « VOTRE DEMANDE : %0A%0A » + contenu.Replace(« <b> », «  »).Replace(« </b> », «  »).Replace(« <br/> », « %0A »).Replace(« <br> », « %0A ») +

                    « %0A%0A » +

                    signature.Replace(« <b> », «  »).Replace(« </b> », «  »).Replace(« <br/> », « %0A »).Replace(« <br> », « %0A ») +

                    « \ »/> » +

                    « Répondre au demandeur</a> » +

                    « <br/> »;

            mail.IsBodyHtml = true;

            SmtpClient smtp = new SmtpClient(smtp_server, 25);

            System.Net.NetworkCredential UserInfo = new System.Net.NetworkCredential(smtp_user, smtp_password);

            smtp.UseDefaultCredentials = false;

            smtp.Credentials = UserInfo;

            smtp.Send(mail);

            return «  »;

        }

        catch (Exception exc)

        {

            return exc.Message;

        }

    }

Laisser un commentaire

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *