Example #1
0
        private void SendMadrillEmail(string recipientMail, string password)
        {
            try
            {
                string APIKey = "QnTXW0l65PKrUWUx4oScUQ";

                MandrillApi.MandrillApi _mapi = new MandrillApi.MandrillApi(APIKey, "json");


                string pong = _mapi.Ping();


                // Here an anonymous object is created as the message parameters. There
                // are additional values, you need to refer to the Mandrill ApI page,
                // as at the time of this version, the Api is still changing.


                List <Recipient> recipients = new List <Recipient>();

                Recipient rec = new Recipient();
                rec.email = recipientMail; //"*****@*****.**";
                rec.name  = recipientMail; //"papapofrfyriou p.";

                recipients.Add(rec);

                object message = new
                {
                    html         = "",
                    text         = string.Format("Welcome to .... \n Your Username is:{0} \n and your password is: {1}", recipientMail, password),
                    subject      = "New user info",
                    from_email   = "*****@*****.**",
                    from_name    = "papaporfyriou",
                    to           = recipients,//new List<Recipient>(),
                    track_clicks = false,
                    track_opens  = false,
                    auto_text    = false,
                    url_strip_qs = false,
                    bcc_address  = "",//"*****@*****.**",
                    merge        = false
                };

                // Here the message created above is used in the send message
                List <MandrillApi.Model.RecipientReturn> returnValue = _mapi.send(message);

                int aa = 0;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #2
0
        private void SendMadrillEmail(string recipientMail, string password)
        {
            try
            {
                string APIKey = "QnTXW0l65PKrUWUx4oScUQ";

                MandrillApi.MandrillApi _mapi = new MandrillApi.MandrillApi(APIKey, "json");


                string pong = _mapi.Ping();


                // Here an anonymous object is created as the message parameters. There 
                // are additional values, you need to refer to the Mandrill ApI page,
                // as at the time of this version, the Api is still changing. 


                List<Recipient> recipients = new List<Recipient>();

                Recipient rec = new Recipient();
                rec.email = recipientMail;//"*****@*****.**";
                rec.name = recipientMail;//"papapofrfyriou p.";

                recipients.Add(rec);

                object message = new
                {
                    html = "",
                    text = string.Format("Welcome to .... \n Your Username is:{0} \n and your password is: {1}", recipientMail, password),
                    subject = "New user info",
                    from_email = "*****@*****.**",
                    from_name = "papaporfyriou",
                    to = recipients,//new List<Recipient>(),
                    track_clicks = false,
                    track_opens = false,
                    auto_text = false,
                    url_strip_qs = false,
                    bcc_address = "",//"*****@*****.**",
                    merge = false
                };

                // Here the message created above is used in the send message
                List<MandrillApi.Model.RecipientReturn> returnValue = _mapi.send(message);

                int aa = 0;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }