Re: MailBox messages relay - WeOnlyDo Discussion board

Re: MailBox messages relay (General questions)

by centurion, Monday, September 04, 2006, 19:15 (6655 days ago) @ wodDrazen

It doesn't help. I tryied to use SetFilename(...) for ISmtpMessage, IMessage and other stuff, but I have only one result = Exception.
I'll post my sample code.

ISmtpRelays Relays(Server.GetRelays());

IMessages Messages(Mailbox.GetMessages());
for (short message = 0; message < Messages.GetCount(); message++)
{
IMessage Message = Messages.GetItem(message);
Message.Save(L C:\Samle\Test.eml , COleVariant(0L));
Relays.Add(Message);
}
or
IMessages Messages(Mailbox.GetMessages());
for (short message = 0; message < Messages.GetCount(); message++)
{
IMessage Message = Messages.GetItem(message);
Message.Save(L C:\Samle\Test.eml , COleVariant(0L));
ISmtpMessage SmtpMessage;
SmtpMessage.SetFilename(L C:\Samle\Test.eml );
Relays.Add(SmtpMessage);
}

BTW. Relays.Add(SmtpMessage); works in MailRecieved(...) notify.

Please help me. You have a good product but it's a bit tricky.


Complete thread: