Results 1 to 10 of 10

Thread: send email from shared mailbox

  1. #1

    Thread Starter
    Member
    Join Date
    Jul 2020
    Posts
    51

    send email from shared mailbox

    Hi to everybody,
    i'm supposed to send an email as customer care from a shared mailbox to several addresses of my company customers.
    i'm using mailkit library and i use this code
    Code:
    Dim contenutomail As New MimeKit.BodyBuilder
    Dim smtpclient As New MailKit.Net.Smtp.SmtpClient
     Dim mail As New MimeKit.MimeMessage
     smtpclient.Connect("smtp.office365.com", 587, MailKit.Security.SecureSocketOptions.StartTls)
     smtpclient.Authenticate("eurostar_italia@mycompany.com", "Aprile22")
     mail.From.Add(New MimeKit.MailboxAddress("", "customeroffice@mycompany.com"))
      For i = 0 To mailinglist.Count - 1
     mail.Bcc.Add((New MimeKit.MailboxAddress("",mailinglist(i).ToString)))
     Next
     contenutomail.TextBody = ""
     contenutomail.HtmlBody = "hello world"
            mail.Body = contenutomail.ToMessageBody
            smtpclient.Send(mail)
            smtpclient.Disconnect(True)
    the problem is : sent mail are save in MY personal account SENT mailbox instead of shared SENT mailbox
    can anyone help me ? i don't want to save a copy,i want the mail sent to be saved in the sent shared mailbox
    i can't solve it
    thanks
    fabio
    Last edited by eurostar_italia; Aug 7th, 2022 at 12:35 PM.

  2. #2

    Thread Starter
    Member
    Join Date
    Jul 2020
    Posts
    51

    Re: send email from shared mailbox

    question up

  3. #3
    PowerPoster
    Join Date
    Nov 2017
    Posts
    3,140

    Re: send email from shared mailbox

    Well, from your example, I'm assuming that your personal mailbox is illustrated as "eurostar_italia@mycompany.com", and the shared mailbox is "customeroffice@mycompany.com".

    I've never used MailKit, but the thing that stands out to me is that the credentials you are using to authenticate are for the "eurostar_italia@mycompany.com" (your?) account, so I would imagine that is why the email that is sent is going to the Sent items of that mailbox. So, my suggestion would be to change the authentication code to authenticate as the "customeroffice@mycompany.com" instead.

    Good luck.

  4. #4

    Thread Starter
    Member
    Join Date
    Jul 2020
    Posts
    51

    Re: send email from shared mailbox

    Quote Originally Posted by OptionBase1 View Post
    Well, from your example, I'm assuming that your personal mailbox is illustrated as "eurostar_italia@mycompany.com", and the shared mailbox is "customeroffice@mycompany.com".

    I've never used MailKit, but the thing that stands out to me is that the credentials you are using to authenticate are for the "eurostar_italia@mycompany.com" (your?) account, so I would imagine that is why the email that is sent is going to the Sent items of that mailbox. So, my suggestion would be to change the authentication code to authenticate as the "customeroffice@mycompany.com" instead.

    Good luck.
    thank you for your reply.the point is the only way to access the shared mailbox is to use personal ID.
    even in office365.com i must entry my mailbox and then open the shared one

  5. #5
    PowerPoster
    Join Date
    Nov 2017
    Posts
    3,140

    Re: send email from shared mailbox

    MailKit seems to be a 3rd party component. Do they have tech support or an online forum where you can ask them questions directly? Or possibly this is a question for Microsoft regarding how Office365 handles shared mailbox access.

    In any event, this seems like a very specific question about that component, and not necessarily a VB.NET question, since the same situation would be encountered if this were being written in C# or other languages.

  6. #6
    PowerPoster jdc2000's Avatar
    Join Date
    Oct 2001
    Location
    Idaho Falls, Idaho USA
    Posts
    2,399

    Re: send email from shared mailbox

    There has to be some way to authenticate in order to access any mailbox, even a shared one, or else spammers would be using it to send out spam. Perhaps a more detailed description of what you are actually wanting to be able to do would be helpful.

  7. #7

    Thread Starter
    Member
    Join Date
    Jul 2020
    Posts
    51

    Re: send email from shared mailbox

    Quote Originally Posted by jdc2000 View Post
    There has to be some way to authenticate in order to access any mailbox, even a shared one, or else spammers would be using it to send out spam. Perhaps a more detailed description of what you are actually wanting to be able to do would be helpful.
    well,
    i work in a small customer care office;we send formatted mail to our customer creating a new message with outlook client.
    the mailbox is a shared mailbox of office 365
    I tried to automate it ,creating a vb.net program to send mail,importing addresses and body message from other resources.
    With my code i did it ,but sent mail are stored in MY sent mailbox instead of the one shared.
    I don't know wy,probably due to the authentication...

  8. #8
    PowerPoster jdc2000's Avatar
    Join Date
    Oct 2001
    Location
    Idaho Falls, Idaho USA
    Posts
    2,399

    Re: send email from shared mailbox

    If you are using Office / Outlook 365, then it is not possible to save the Sent mail in ONLY the shared mailbox sent folder. You would need your own Exchange Server to do that.

    Possibly useful links:

    https://docs.microsoft.com/en-us/exc...l-is-not-saved

    https://www.slipstick.com/exchange/s...server-cmdlet/

    https://m365scripts.com/exchange-onl...hared-mailbox/

  9. #9

    Thread Starter
    Member
    Join Date
    Jul 2020
    Posts
    51

    Re: send email from shared mailbox

    Quote Originally Posted by jdc2000 View Post
    If you are using Office / Outlook 365, then it is not possible to save the Sent mail in ONLY the shared mailbox sent folder. You would need your own Exchange Server to do that.

    Possibly useful links:

    https://docs.microsoft.com/en-us/exc...l-is-not-saved

    https://www.slipstick.com/exchange/s...server-cmdlet/

    https://m365scripts.com/exchange-onl...hared-mailbox/

    ok probably my project will not go on.there's no way to do that.thank you for your reply

  10. #10
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,543

    Re: send email from shared mailbox

    thought - don't know if this will work or not ...
    but you could sent hte emal to the shared address via a BCC (blind courtesy copy) ... then have a rule on the folder that then moves it to a separate folder instead of the inbox.


    random thought. No clue if that would work or not.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width