Hi all

Thank you for all your fed back finally i got the solution to send the
mail request through the C# code using outlook
********************************
SmtpClient sc = new SmtpClient("mail.streme.tv");
            MailMessage msg = new MailMessage();
            msg.From = new MailAddress("[email protected]",
"Yogesh Dige");
            msg.To.Add(new MailAddress("[email protected]",
"Yogesh Dige"));
            msg.Subject = "Send Calendar Appointment Email";
            msg.Body = "Hi this is test mail for testing ";

            StringBuilder str = new StringBuilder();
            str.AppendLine("BEGIN:VCALENDAR");
            str.AppendLine("PRODID:-//Ahmed Abu Dagga Blog");
            str.AppendLine("VERSION:2.0");
            str.AppendLine("METHOD:REQUEST");
            str.AppendLine("BEGIN:VEVENT");
            //str.AppendLine(string.Format("DTSTART:
{0:yyyyMMddTHHmmssZ}", dtStartDateTime));
            DateTime dtTemp = DateTime.UtcNow.Subtract(new TimeSpan
(05, 30, 00));
            //str.AppendLine(string.Format("DTSTAMP:
{0:yyyyMMddTHHmmssZ}", dtTemp));
            //str.AppendLine(string.Format("DTEND:
{0:yyyyMMddTHHmmssZ}", dtEndDateTime));
            str.AppendLine(string.Format("DTSTART:
{0:yyyyMMddTHHmmssZ}", dtStartDateTime));
            str.AppendLine(string.Format("DTSTAMP:
{0:yyyyMMddTHHmmssZ}", DateTime.UtcNow));
            str.AppendLine(string.Format("DTEND:{0:yyyyMMddTHHmmssZ}",
dtEndDateTime));
            str.AppendLine("LOCATION: Mumbai");
            str.AppendLine(string.Format("UID:{0}", Guid.NewGuid()));
            str.AppendLine(string.Format("DESCRIPTION:{0}",
msg.Body));
            str.AppendLine(string.Format("X-ALT-DESC;FMTTYPE=text/html:
{0}", msg.Body));
            str.AppendLine(string.Format("SUMMARY:{0}", msg.Subject));
            str.AppendLine(string.Format("ORGANIZER:MAILTO:{0}",
msg.From.Address));
            str.AppendLine(string.Format("ATTENDEE;CN=
\"{0}\";RSVP=TRUE:mailto:{1}";, msg.To[0].DisplayName, msg.To
[0].Address));
            str.AppendLine("BEGIN:VALARM");
            str.AppendLine("TRIGGER:-PT15M");
            str.AppendLine("ACTION:DISPLAY");
            str.AppendLine("DESCRIPTION:Reminder");
            str.AppendLine("END:VALARM");
            str.AppendLine("END:VEVENT");
            str.AppendLine("END:VCALENDAR");
            System.Net.Mime.ContentType ct = new
System.Net.Mime.ContentType("text/calendar");
            ct.Parameters.Add("method", "REQUEST");
            AlternateView avCal =
AlternateView.CreateAlternateViewFromString(str.ToString(), ct);
            msg.AlternateViews.Add(avCal);

            sc.Send(msg);
*********************************************************************************
Hope this will be helpfull so i am putting it here.

Thank you

On Sep 21, 3:45 pm, Yogesh Dige <[email protected]> wrote:
> hi
>
> I want to create the service which will run on server and will send
> the mails for that i need
> 1) send the meeting request to the person using the outlook
> 2) and as i am sending through the service in mail it should be like
> behalf of ( other user.)
>
> see i tried but into the Microsoft.Office.Interop.Outlook.MailItem
> here i am getting the  Behalf of option and in
> Microsoft.Office.Interop.Outlook.appointment Item i am getting the
> Request option but i want these both option in one class.
>  so i can send the request onbehalf of  some person to the another
> user.
>
> So basically my need is want to create the Service which will send the
> Meeting request through the outlook on behalf of another user.
>
> thanks in advance..

Reply via email to