Example #1
0
        //        public void Send_textWithCC(string to,string subject,string textMail,string textCCMailAddress )
        //        {
        //
        //        }
        public void Send_text(string to,string subject,string textMail )
        {
            try
            {
                ma1= new Mapi();
                ma1.AddRecip(to, null, false );
                /*
                if( textCC.Text != null )
                {
                    if( textCC.Text.Length > 0 )
                        ma.AddRecip( textCC.Text, null, true );
                }
                */
                //lblStatus.Text="Current Status :  Sending Message";
                if( ! ma1.Send( subject, textMail ) )
                    MessageBox.Show( this, "MAPISendMail failed! " + ma1.Error(), "Send Mail", MessageBoxButtons.OK, MessageBoxIcon.Warning );

                ma1.Reset();
                //this.Close();
            }
            catch(Exception exp)
            {
                MessageBox.Show(exp.Message.ToString());
            }
        }