none
Sending mail error?? RRS feed

  • Question

  •      MailMessage message = new MailMessage

                {
                    To = "braino@gmail.com",
                    Bcc = "info@braino.com",
                    From = "info@braino.com"
                };
                this.message = "<html><head></head><body>";


                this.message = this.message + "</body></html>";
                if ((this.FileUpload1.PostedFile != null) && (this.FileUpload1.PostedFile.ContentLength > 0))
                {
                    string fileName = Path.GetFileName(this.FileUpload1.PostedFile.FileName);
                    this.FileUpload1.PostedFile.SaveAs(base.Server.MapPath("registration/" + fileName));
                    MailAttachment attachment = new MailAttachment(base.Server.MapPath("registration/" + fileName));
                    message.Attachments.Add(attachment);
                }
                message.Subject = "Registration Form Brainobrain Jumeira";
                SmtpMail.SmtpServer = ConfigurationSettings.AppSettings["MySMTPServer"];
                message.BodyFormat = MailFormat.Html;
                message.Body = this.message;
                SmtpMail.Send(message);
                this.txtchname.Focus();
                MailMessage message2 = new MailMessage
                {
                    To = this.txtemail.Text,
                    From = "info@braino.com"
                };
                this.message1 = "<html><head></head><body>";
                this.message1 = this.message1 + "<table align=center><tr><td>Thank you for registring your child.<br/><br/>Thanks,BrainoTeam</td><tr></table>";
                this.message1 = this.message1 + " </body></html>";
                message2.Subject = "Registration Form Braino";
                SmtpMail.SmtpServer = ConfigurationSettings.AppSettings["MySMTPServer"];
                message2.BodyFormat = MailFormat.Html;
                message2.Body = this.message1;
                SmtpMail.Send(message2);
                base.Response.Redirect("sendmessage.aspx");
            }

    Error:

    Warning 69 'System.Configuration.ConfigurationSettings.AppSettings' is obsolete: 'This method is obsolete, it has been replaced by System.Configuration!System.Configuration.ConfigurationManager.AppSettings' C:\DevProjects\BrainO\BrainO\Registration.aspx.cs 135 35 BrainO

    Warning 68 'System.Web.Mail.SmtpMail' is obsolete: 'The recommended alternative is System.Net.Mail.SmtpClient. http://go.microsoft.com/fwlink/?linkid=14202' C:\DevProjects\BrainO\BrainO\Registration.aspx.cs 135 13 BrainO

    Warning 70 'System.Web.Mail.MailFormat' is obsolete: 'The recommended alternative is System.Net.Mail.MailMessage.IsBodyHtml. http://go.microsoft.com/fwlink/?linkid=14202' C:\DevProjects\BrainO\BrainO\Registration.aspx.cs 136 34 BrainO

           
    • Edited by SSmadhu Monday, July 23, 2012 7:05 AM
    Monday, July 23, 2012 7:04 AM

Answers