dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: Save mail to draft in .net

  1. #1
    Join Date
    May 2011
    Posts
    3

    Save mail to draft in .net

    Hi all,

    i have a code written for Send mail in asp.ent. This is just so that two users can communicate
    protected void Button1_Click(object sender, EventArgs e)
    {
    SmtpClient client = new SmtpClient["smtpserver.company.com",25);
    client.Credentials = new NetworkCredential["user@xyz.com",Password);
    MailMessage msg = new MailMessage();
    msg.From = new MailAddress(TxtFrom.Text);
    msg.To.Add(new MailAddress(TxtTO.Text);
    msg.Subject = TxtSubject.Text;
    msg.Body = TxtDesc.Text;

    try
    {
    client.Send(msg);
    }
    catch(Exception ex)
    {
    Label5.Text = "Unable to send mail";
    }

    }
    }

    This is the code I used for Send functionality

    Now How should I do the "Save to draft". Can we save the mail in Draft using smtpclient class? We can do this using Lotus Notes specific classes but I don't have Lotus Notes installed on my Citrix machin(dev environment). Can we implement it irrespective of mail client?

    Please advise. Thanks in advance.

  2. #2
    Join Date
    May 2011
    Location
    Pune India
    Posts
    4

    Re: Save mail to draft in .net

    hey ..

    check this link :
    http://www.codeproject.com/KB/IP/smt...select=2876398

    I think this is what you are looking for ...

    Cheers !!!

  3. #3
    Join Date
    May 2011
    Posts
    3

    Re: Save mail to draft in .net

    Thanks Sagar. But this link explains how to save mail message to some local drive on the machin. I want a Mail message to get automatically stored in the 'Draft' folder of the User's mailbox. In may case mail client is Lotus Notes. I am trying if this can be achieved with modifications to the given code. Please also let me know if you have any idea about it. Thanks again.

  4. #4
    Join Date
    May 2011
    Posts
    3

    Re: Save mail to draft in .net

    I think 1 way is just to run Mailto script which opens a new mail in User's default mail client. Now I need to attach a file in this mail. My web applications generates a report which should be saved on user machin's Temporary folder and then attached in mail.

    Any idea how to save file on client machin's Temporary folder?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)