sending mails through eM Client

robertvdb

Active Member
Joined
Jan 10, 2021
Messages
327
Office Version
  1. 2016
Platform
  1. Windows
I have a spreadsheet in which, say Column A, contains 100 email addresses.

I need to write the same email to all 100.

I know how to automate this in Outlook, but this code does not seem to work in eM Client.

Does anyone has a sample code for sending mails in em Client ?
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
vba automation only works for Office apps or for apps where the programmers have built dll's or other such library types for integration with Office apps and their code. F'rinstance, Adobe built such libraries for controlling Acrobat (not Acrobat Reader AFAIK) with vba. You'll probably have to contact the em client developers or search their website for info. You might get code from someone here if it exists, but it's likely that if you didn't install or reference the required supporting libraries (assuming they even exist) it wouldn't work anyway.

EDIT - you might want to consider using CDO to directly work with your email server, assuming you have one.
 
Last edited:
Upvote 0
hi Micron, thanks for your answer.

I've been working further on this, and it does seem to work even outside Office apps.

See below code.

The only issue I still have, is that I cannot insert blank lines in the email body text. I mean it doesn't work with vbLf or VbCrLf or similar...

Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)

Dim eMail As String
Dim subjectLine As String
Dim bodyText As String

eMail = ActiveCell.Value
Name = ActiveCell.Offset(0, 1).Value
subjectLine = "this is the subject line"

bodyText = "this is the bodytext"

ThisWorkbook.FollowHyperlink _
"mailto:" & eMail & "?subject=" & subjectLine & "&body=" & bodyText

End Sub
 
Upvote 0
I've never tried to send mail using mailto: so I don't know if using html tags would fix that or not.
You might try bodytext & "<P>" or bodytext & vbNewLine or bodytext & Chr(13) & Chr(10)
 
Upvote 0

Forum statistics

Threads
1,214,591
Messages
6,120,425
Members
448,961
Latest member
nzskater

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top