• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 201
  • Last Modified:

Sending an email from .net remoting software

Hi All,
I am asking this question for my development team.  We have created a .net remoting application in C#.  We have a server manager and a thick client.  The server manager currently communicates with the SQL server and the accounting software.  The development team would like to have the application create and send an email automatically after the user clicks accept on one of the winforms. THey do not want Outlook or any other email client to be displayed.  This should completely happen in the background.  The address of the recipient will be setup on one of the other winforms.  So here are my questions...

1.  How can this be done?  Is there an object in VS 2003 that is already capable of doing this?

2.  SHould the client or the server manager create and send the email?

3.  Does Microsoft Exchange or another email system need to be available on the LAN or can the application send the email directly to the email recipient's email server.

I am sure that this is not as easy as I am making it out to be.  But I am looking for some information so that my development team can begin the process of adding this component.

Any help would be  greatly appreciated.

Scott

0
smpross
Asked:
smpross
1 Solution
 
anand2kCommented:
0
 
smprossAuthor Commented:
Anand,
I would like to have the system send the email without any user interation.  The email should be send without displaying a GUI.

Any suggestions?

Scott
0
 
CynergySoftwareCommented:
in it's simplest form here.

using System.Net.Mail;

MailMessage mail = new MailMessage(fromAddress, toAddress);
try
{                      
            mail.Subject = "Subject Here";
            mail.IsBodyHtml = true; // true/false value
            mail.Priority = MailPriority.Normal;
            mail.Body = "Body Message"
            SmtpClient mailClient = new SmtpClient(mailServer);
            mailClient.Send(mail);
        }
        catch (Exception ex)
        {
            Response.Write(ex.Message);
        }
        finally
        {
            mail = null;
        }
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now