Quantcast
Channel: Exchange Server Development forum
Viewing all articles
Browse latest Browse all 7132

Mail is goes in official Calandar

$
0
0

Dear All,

I have written a code for send appointment in exchange server,

I am sending email to hardik.ramwani@abc.com.

There will be 2 calendar in the Outlook :

1) Official

2)hardik.ramwani@annet.com

Now i have written to :  "hardik.ramwani@abc.com" still it goes inofficial calendar.

I need appointment in "hardik.ramwani@abc.com" calandar.

Is there any setting that i have to make in code ?

Code :

   SmtpClient sc = new SmtpClient();

   sc.Host = "exc12345";
   sc.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials;

  string apdate = AppointmentDate.ToString("yyyyMMdd");
        MailMessage msg1 = new MailMessage();

        msg1.From = new MailAddress("hardik.ramwani@abc.com");
        msg1.To.Add(new MailAddress(propertyEmail));
        msg1.Subject = "Book A Viewing Appointment Email";
        msg1.Body = "Applicant Name = " + ApplicantName.ToString() ;      System.Net.Mime.ContentType ct = new System.Net.Mime.ContentType("text/calendar");
        ct.Parameters.Add("method", "REQUEST");
        AlternateView avCal = AlternateView.CreateAlternateViewFromString(str.ToString(), ct);
        msg1.AlternateViews.Add(avCal);

        sc.Send(msg1);

Thanks and regards,

Hardik Ramwani


Viewing all articles
Browse latest Browse all 7132

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>