locked
problem while sending mails using smtp RRS feed

  • Question

  • please check my website http://www.trs-it-solutions.com/


    i can't send mail from this now
    but i was able to send from locle server
    when you go in 'order a project' or 'contact us' it send a mail to the user and me.
    but it is not sending now
    it was sending when i was checking on my browser local server
    i am using smtp to send mails

    do you know any thing about it...?

    Please help me i am stuck here ..

     string from = "trshelpline@gmail.com";
            string to = "trshelpline@gmail.com";
            string subject = this.Name + " needs a " + this.projectName + "in Euro " + this.Budget;
            string body = "Hi Trs, \n \t";
            body = body + this.ProjectDetails+"\n \t";
            body = body + "Email Id:    " + this.EmailID + "\n ";
            body = body +"Contact No:  "+ this.ContactNo + "\n ";
            body = body + this.Queries + "\n \n";
            body = body + "Thanks & Regards \n ";
            body = body + this.Name;
           
    
            //EMAIL Sending  to  US....................
    
    
            MailMessage objMail = new MailMessage(from, to,subject, body);
            NetworkCredential objNC = new NetworkCredential(from, "mypassword");
            SmtpClient objsmtp = new SmtpClient("smtp.gmail.com", 587); // for Gmail
            objsmtp.EnableSsl = true;
            objsmtp.Credentials = objNC;
            objsmtp.Send(objMail);
    
            //Email sending to client
            from = "trshelpline@gmail.com";
            to = this.EmailID;
            body = "Hi " + this.Name + ", \n \t";
            body = body + "we have received your project order having below description .\n \t";
            body = body + this.ProjectDetails + "\n \t";
            body = body + "we will get back to you very soon. \n";
            body = body + "Thanks and regards\n";
            body = body + "Team TRS \n\n\n\n";
            //body = body + "this is system generated mail please do not reply.";
            subject = "Order confirmation mail from TRS Solutions";
            objMail = new MailMessage(from, to, subject, body);
            objNC = new NetworkCredential(from, "mypassword");
            objsmtp = new SmtpClient("smtp.gmail.com", 587); // for Gmail
            objsmtp.EnableSsl = true;
            objsmtp.Credentials = objNC;
            objsmtp.Send(objMail);
    
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Your Order has been placed.          A confirmation mail has been sent to your mailId please check your inbox.       Thanks For believing us.')", true);
    

    Thank you for your help and time.

    Nitesh

    • Moved by Eason_H Monday, October 28, 2013 5:44 AM
    Saturday, October 26, 2013 7:04 PM

Answers

  • Hi NK,

    This forum is to discuss problems of C# development.Since the issue regards ASP.NET and website deployment. I suggestion you post the question in the ASP.NET forums at http://forums.asp.net/. It is appropriate and more experts will assist you.

    Thanks


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Proposed as answer by Just Karl Monday, October 28, 2013 8:25 PM
    • Marked as answer by Just Karl Wednesday, November 6, 2013 11:22 PM
    Monday, October 28, 2013 5:44 AM