Hi,

I am sending emails through webservices, I am calling the webservice from my website and passing all the arguments to it ,until now no problem.

But now I want the webservice to inform the user if an error or exception occurs is there a way by which I can do so?
Any help shall be appreciated!

Thanks
shankbond

Catch and display the error .. or mail it ..

Catch and display the error .. or mail it ..

Hi Vasanth,
I don't want to report the error by sending him a mail. Can You please provide some sample code?


Thanks

Please mention how the error is to be displayed. Web form or any other ?
My requirement was to display the error in webform as below :

public partial class www_sendmail : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string param = ""+Request.QueryString["param"];
        try
        {
	    if (param == "BIRTHDAY")
            {
                string fpath = Server.MapPath("");
                Wishes wish = new Wishes();
                string strStatus = wish.sendMail(fpath);
                lblRemarks.Text = strStatus;
            }
			
        }
        catch (Exception ex)
        {
            // your error by mail or text
            // wish.sendMail("....");
            lblRemarks.Text = ex.ToString();
        }
    }
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.