Re: The sender problems, help me pls?

Discussion in 'Microsoft Outlook Program Addins' started by Dmitry Streblechenko, Jan 6, 2009.

  1. UseMailItem.SendUsingAccount property (Outlook 2007 specific).

    --
    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/
    OutlookSpy - Outlook, CDO
    and MAPI Developer Tool
    -
    "ryotyankou via OfficeKB.com" <u48591@uwe> wrote in message
    news:8fc5a50ffeeda@uwe...
    > My first problem is fixed, save the item, the getprops, it is ok. The
    > error i
    > said before is caused by other reason.
    > Then, how about my second problem? Thx very much.
    >
    > --
    > Message posted via OfficeKB.com
    > http://www.officekb.com/Uwe/Forums.aspx/outlook-prog-addins/200901/1
    >
     
    Dmitry Streblechenko, Jan 6, 2009
    #1
    1. Advertisements

  2. You can set these properties using Extended MAPI (shouldn't be a problem if
    you are using C++) - IMessage interface can be obtained through the
    MailItem.MAPIOBJECT property. To retrieve the accoutn naame and id, use the
    IOlkAccountManager interface.

    --
    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/
    OutlookSpy - Outlook, CDO
    and MAPI Developer Tool
    -
    "ryotyankou via OfficeKB.com" <u48591@uwe> wrote in message
    news:8fd0a5122dad4@uwe...
    > Thank you Dmitry, but how about outlook2003, the main task of our product
    > should be implemented on 2003 not 2007.(I known outlook2007 have some new
    > interfaces and structruces can do the job easily).
    >
    > Dmitry Streblechenko wrote:
    >>UseMailItem.SendUsingAccount property (Outlook 2007 specific).

    >
    > --
    > Message posted via OfficeKB.com
    > http://www.officekb.com/Uwe/Forums.aspx/outlook-prog-addins/200901/1
    >
     
    Dmitry Streblechenko, Jan 8, 2009
    #2
    1. Advertisements

  3. The first account in the list returned by IOlkAccountManager::GetOrder
    method is teh default one.
    You can play with IOlkAccountManager in OutlookSpy - click Misc |
    IOlkAccountManager.

    --
    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/
    OutlookSpy - Outlook, CDO
    and MAPI Developer Tool
    -
    "ryotyankou via OfficeKB.com" <u48591@uwe> wrote in message
    news:8fdf87823e701@uwe...
    > That's great, i will try it tommorrow. How can i use this interface to set
    > the account to send email? I find a sample on codeproject.com. It can
    > retrieve all accounts, but how to set the default account, the SetOrder()
    > function? But how could i know which one is the current default account?
    > Thanks very much.
    >
    > Dmitry Streblechenko wrote:
    >>You can set these properties using Extended MAPI (shouldn't be a problem
    >>if
    >>you are using C++) - IMessage interface can be obtained through the
    >>MailItem.MAPIOBJECT property. To retrieve the accoutn naame and id, use
    >>the
    >>IOlkAccountManager interface.
    >>

    >
    > --
    > Message posted via OfficeKB.com
    > http://www.officekb.com/Uwe/Forums.aspx/outlook-prog-addins/200901/1
    >
     
    Dmitry Streblechenko, Jan 9, 2009
    #3
  4. Do not reset the default account, simply set the appropriate named
    properties on the message to tell Outlook which account it should use for
    sending.

    --
    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/
    OutlookSpy - Outlook, CDO
    and MAPI Developer Tool
    -
    "ryotyankou via OfficeKB.com" <u48591@uwe> wrote in message
    news:8feb53939ec5d@uwe...
    > Thank you Dmitry, the IOlkAccountManager can Set the default account, but
    > i
    > still have question here.
    > Say A is the default account, B is another, and C send a message to B. B
    > should auto reply a message to C.
    > This is my code flow for repy message to C:
    > 1. Set specified account(B) as default.(SetOrder)
    > 2. Create the message and send it.
    > 3. Restore the original account(A).(SetOrder again)
    > well, the problem is that How could i known when the message is already
    > sent.
    > The result of my code is alway send by A. If i mark the 3. It can
    > work(send
    > by B). But it is bad for that change the default account and user may
    > don't
    > know that, right?
    > In one word, when should i do the action 3?
    > Thanks in advance.
    >
    > Dmitry Streblechenko wrote:
    >>The first account in the list returned by IOlkAccountManager::GetOrder
    >>method is teh default one.
    >>You can play with IOlkAccountManager in OutlookSpy - click Misc |
    >>IOlkAccountManager.
    >>

    >
    > --
    > Message posted via OfficeKB.com
    > http://www.officekb.com/Uwe/Forums.aspx/outlook-prog-addins/200901/1
    >
     
    Dmitry Streblechenko, Jan 9, 2009
    #4
  5. How exactly do you send the message?
    Are you sure you set these properties correctly? Did you compare the values
    to the messages sent through through teh UI?

    --
    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/
    OutlookSpy - Outlook, CDO
    and MAPI Developer Tool
    -
    "ryotyankou via OfficeKB.com" <u48591@uwe> wrote in message
    news:9002741789ae6@uwe...
    > Could you pls tell me which properties i should use. CurrentItem-
    >>SendOnBehalfOfName(Exchange only)can't work, mine is POP3/SMTP. Also I

    > change the IMessage's 0x8013 InetAcctID and InetAcctName manually, it
    > still
    > use the default account to send my mail. The PR_SENDEMAIL_ADDRESS,
    > PR_SENDEMAILNAME can't work at all. And I can't find PR_PRESENTING_XXXX in
    > IMessage via outlookspy.
    >
    > Dmitry Streblechenko wrote:
    >>Do not reset the default account, simply set the appropriate named
    >>properties on the message to tell Outlook which account it should use for
    >>sending.
    >>

    >
    > --
    > Message posted via OfficeKB.com
    > http://www.officekb.com/Uwe/Forums.aspx/outlook-prog-addins/200901/1
    >
     
    Dmitry Streblechenko, Jan 12, 2009
    #5
  6. You are posting through officekb.com, not direcly to the Microsoft server.
    I saw your reply just fine, but I don't think you answered my questions:

    1. How exactly do you send the message?
    2. Are you sure you set these properties correctly? Did you compare the
    values to the messages sent through through the UI? I mean the message
    properties that hold the account name and id, not the
    PR_SENT_REPRESENTING_XXX properties.


    --
    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/
    OutlookSpy - Outlook, CDO
    and MAPI Developer Tool
    -
    "ryotyankou via OfficeKB.com" <u48591@uwe> wrote in message
    news:901b18c3d6ad3@uwe...
    > oh, no, Should this be a bug for this discuss forum? I posted a reply, but
    > when you are in reply action, you can't see it. After you click post
    > button,
    > you can see the reply i were posted.
    > ////////////////////////////This is what i posted last
    > time//////////////////////////////
    > Hi, Dmitry. I have successfully set the PR_SENT_REPRESENTING_XXX. Say,
    > Outlook have two accounts, (default), . Then
    > ccc@ccc.
    > com send a message to . ok, my code generate a message, and
    > sent
    > it to . But it is strange that the message received
    > is
    > something like(you should open the mail by double click the message):
    > FROM: representing
    > TO:
    >
    > But the item in folder show that the sender is .
    > So actually, the message is send by the default account . What
    > should i do to use send the mail? Or just change "FROM:
    > aaa@aaa.
    > com representing " to "."
    > ////////////////////////////////////////////////Last posted
    > end//////////////////////////////////
    > As i mentioned in this post, and i check the message while receive it. The
    > PR_SENT_REPRESENTING_XXX is currently set.
    > My questiones are:
    > 1. What should i do to use send the mail?
    > 2. Or just change "FROM: representing " to
    > "bbb@bbb.
    > com."
    >
    >
    > Dmitry Streblechenko wrote:
    >>How exactly do you send the message?
    >>Are you sure you set these properties correctly? Did you compare the
    >>values
    >>to the messages sent through through teh UI?
    >>
    >>> Could you pls tell me which properties i should use. CurrentItem-
    >>>>SendOnBehalfOfName(Exchange only)can't work, mine is POP3/SMTP. Also I

    >>[quoted text clipped - 7 lines]
    >>>>properties on the message to tell Outlook which account it should use
    >>>>for
    >>>>sending.

    >
    > --
    > Message posted via http://www.officekb.com
    >
     
    Dmitry Streblechenko, Jan 13, 2009
    #6
  7. After you set these two properties, does Outlook display the right account
    when you open the message?
    Youy are sending through SMTP, not Exchange, right?

    --
    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/
    OutlookSpy - Outlook, CDO
    and MAPI Developer Tool
    -
    "ryotyankou via OfficeKB.com" <u48591@uwe> wrote in message
    news:9028cee28a518@uwe...
    >I noticed that if i choose sender by click droplist and then save the
    >message.
    > Just two properties is changed obviously. Do you mean the two properties?
    > In
    > fact, i tried these two before, but i didn't know how to set them, i
    > search
    > through the network, but found too few to use. Can you help me for that
    > how
    > can i do deal with this? Any tips or links will ok. Thank you in advance.
    >
    >>2. Are you sure you set these properties correctly? Did you compare the
    >>values to the messages sent through through the UI? I mean the message
    >>properties that hold the account name and id, not the
    >>PR_SENT_REPRESENTING_XXX properties.
    >>

    >
    > --
    > Message posted via http://www.officekb.com
    >
     
    Dmitry Streblechenko, Jan 14, 2009
    #7
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mihail Edkov

    Again about getting sender address when send mail ?

    Mihail Edkov, Jul 8, 2003, in forum: Microsoft Outlook Program Addins
    Replies:
    2
    Views:
    1,342
    Mihail Edkov
    Jul 9, 2003
  2. Jenny Tam

    Re: Sender properties for new messages

    Jenny Tam, Oct 23, 2003, in forum: Microsoft Outlook Program Addins
    Replies:
    5
    Views:
    1,653
    Jenny Tam
    Oct 27, 2003
  3. Jeremy Pastika

    Use Redemption to retrieve Sender

    Jeremy Pastika, Nov 7, 2003, in forum: Microsoft Outlook Program Addins
    Replies:
    1
    Views:
    628
    Sue Mosher [MVP]
    Nov 7, 2003
  4. T

    Outlook Express reply to a different sender

    T, Nov 14, 2003, in forum: Microsoft Outlook Program Addins
    Replies:
    1
    Views:
    522
    rifleman
    Nov 14, 2003
  5. ksskumar
    Replies:
    2
    Views:
    1,528
    Dirk Schaller
    Jan 31, 2004
Loading...

Share This Page