tutorial: Email automation in Studio (v2024.10)
section: Practice—retrieving, filtering, and sending emails (Gmail with IMAP and SMTP)
step: * Add a Get IMAP Mail Message activity to the workflow. In the MailFolder property field add “Inbox”, in the Port add 993, and add “imap.gmail.com” as Server. In the Email property add GmailCredentials.Username, in the Password property field add GmailCredentials.Password.
There is no “Get IMAP Mail Message” activity. There is a “Get IMAP Email List” activity that I’m trying to use.
I have configured the windows generic credential as per the previous step. I have setup gmail for IMAP and POP, although the options have changed and there is no ‘turn it on’ type radio button for IMAP. Included screenshot for good measure.
When I run the sequence, a dialogue is presented asking for login details - these are prefilled with the credentials. I click ok but then see the error:
“Get IMAP Email List: Object reference not set to an instance of an object.”
The tutorial instructions say to enter the url and port, but these fields don’t exist. It also suggests entering “GmailCredentials.Username” in the username field? What? This doesn’t make sense, but I tried it and still see the same error message about the reference not an instance.
So I’m not sure what to try next. Can anyone help?
Just FYI, the example build falls over in the same way, even though it includes the original “Get IMAP Mail Message” activity.
The Get Username/Password activity prompts for credentials and stores them in Windows Credential Manager. To retrieve existing credentials, you can use Get Secure Credential and point it to the credential entry stored in Windows Credential Manager. Alternatively, if you’re using Orchestrator, you can create a Credential Asset and retrieve it using Get Credential.
Regarding Get IMAP Email List, click Add New Connection and create a Gmail connection. Once the connection is created, select it in the activity and use that connection instead of manually configuring the IMAP settings.
Your error happens because new mail activities require a connection, not credentials—either create a Gmail connection or switch to the classic Get IMAP Mail Messages activity.
thanks again for the help but I’m still having problems. I was using the wrong activity from my previous (deleted) post, but still have errors with the ‘correct’ activity.
The “use gmail” activity works, is this the ‘modern’ method … and should I probably abandon this IMAP connection example?
Is there an IMAP gmail example that actually works you could link me to?
Yes, the Use Gmail activity is the newer and recommended approach. It uses a connection-based authentication model and is generally easier to configure than IMAP/SMTP activities.
If you’re just learning or building a new automation, I would recommend using Integration Service connections. If you cannot find a suitable connector for your requirement, then consider using the traditional approaches.