-
Aug 7th, 2022, 12:17 PM
#1
Thread Starter
Member
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.
-
Aug 9th, 2022, 03:37 AM
#2
Thread Starter
Member
Re: send email from shared mailbox
-
Aug 9th, 2022, 07:44 AM
#3
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.
-
Aug 9th, 2022, 12:18 PM
#4
Thread Starter
Member
Re: send email from shared mailbox
Originally Posted by OptionBase1
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
-
Aug 9th, 2022, 04:22 PM
#5
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.
-
Aug 9th, 2022, 04:27 PM
#6
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.
-
Aug 9th, 2022, 04:43 PM
#7
Thread Starter
Member
Re: send email from shared mailbox
Originally Posted by jdc2000
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...
-
Aug 9th, 2022, 06:10 PM
#8
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/
-
Aug 10th, 2022, 02:45 PM
#9
Thread Starter
Member
Re: send email from shared mailbox
Originally Posted by jdc2000
ok probably my project will not go on.there's no way to do that.thank you for your reply
-
Aug 10th, 2022, 04:22 PM
#10
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|