|
| [C#] | |
| String
GetFrom
(String NotificationID)
|
|
| NotificationID |
| Notification ID |
|
| From string value |
|
| | //Create personalizer object and Session object |
| | PersonalizerRef.Personalizer pers = new PersonalizerRef.Personalizer()
; |
| | SessionRef.Session sess = new SessionRef.Session()
; |
| | string SessionID = ""; |
| | try{ |
| | SessionID = pers.CreateSession("LogonName", "Password"); |
| | //Create Mail notification proxy object |
| | MailRef.Mail objMail = new MailRef.Mail()
; |
| | //Create server notification object |
| | string MailNotifID = sess.CreateMailNotification(SessionID); |
| | objMail.SetFrom(MailNotifID, "infomail@somebody.com")
;
//set "from" address |
| | objMail.SetTo(MailNotifID, "abonent@somebody.com")
;
//set destination address |
| | objMail.SetSubject(MailNotifID, "Notification Mail.")
;
// set subject |
| | objMail.SetFormat( MailNotifID, "text")
;
// set format of message body |
| | objMail.SetBody(MailNotifID, "You have made an appointment on 1:30pm."); |
| | objMail.Send(MailNotifID); |
| | // Print message properties |
| | Console.WriteLine(objMail.GetFrom(MailNotifID)); |
| | Console.WriteLine(objMail.GetTo(MailNotifID)); |
| | Console.WriteLine(objMail.GetSubject(MailNotifID)); |
| | Console.WriteLine(objMail.GetFormat(MailNotifID)); |
| | Console.WriteLine(objMail.GetBody(MailNotifID)); |
| | objMail.Release(MailNotifID); |
| | sess.Release(SessionID); |
| | } |
| | catch(Exception e){ |
| | //Print exception message e.Message |
| | sess.Release(SessionID); |
| | } |