ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Email with mailto equivalent (https://www.excelbanter.com/excel-programming/426078-email-mailto-equivalent.html)

elf27

Email with mailto equivalent
 
Hello,

I've searched the forums and reviewed http://www.rondebruin.nl but I can't
seem to find an answer to a simple question.

I want a macro to email persons in a range and have a custom subject line
but I do not rely on them using outlook. If it's possible, I'd basically like
the equivalent of

mailto:[ARRAY]?subject=Item [VARIABLE X] Posted Online

Any way to do that?

Jacob Skaria

Email with mailto equivalent
 
I am not sure whether I have understood your question...Please elaborate your
query if you are looking for something else.

strToIDs = Combine(ARRAY,";")
strSubject = "------------------"

With OutMail
.To = strToIDs
.CC = ""
.BCC = ""
.Subject = strSubject
.Body = "Hi there"
.Attachments.Add ("C:\test.txt")
.Send
End With

If this post helps click Yes
---------------
Jacob Skaria


"elf27" wrote:

Hello,

I've searched the forums and reviewed http://www.rondebruin.nl but I can't
seem to find an answer to a simple question.

I want a macro to email persons in a range and have a custom subject line
but I do not rely on them using outlook. If it's possible, I'd basically like
the equivalent of

mailto:[ARRAY]?subject=Item [VARIABLE X] Posted Online

Any way to do that?


elf27

Email with mailto equivalent
 
Thanks, Jacob but it didn't work.
Excel didn't like the Combine function.
But, that's basically the right idea. The trouble I'm having is getting an
array of cells with different emails to all be combined in to one string.
then I'll put it in the following:

ThisWorkbook.FollowHyperlink Address:="mailto:" & ARRAY WITH EMAILS
&"?Subject=Blah blah blah"

"Jacob Skaria" wrote:

I am not sure whether I have understood your question...Please elaborate your
query if you are looking for something else.

strToIDs = Combine(ARRAY,";")
strSubject = "------------------"

With OutMail
.To = strToIDs
.CC = ""
.BCC = ""
.Subject = strSubject
.Body = "Hi there"
.Attachments.Add ("C:\test.txt")
.Send
End With

If this post helps click Yes
---------------
Jacob Skaria


"elf27" wrote:

Hello,

I've searched the forums and reviewed http://www.rondebruin.nl but I can't
seem to find an answer to a simple question.

I want a macro to email persons in a range and have a custom subject line
but I do not rely on them using outlook. If it's possible, I'd basically like
the equivalent of

mailto:[ARRAY]?subject=Item [VARIABLE X] Posted Online

Any way to do that?


Dave Peterson

Email with mailto equivalent
 
Maybe something like:

Option Explicit
Sub testme()

Dim myAddrRng As Range
Dim URL As String
Dim myStr As String
Dim myCell As Range

Set myAddrRng = Worksheets("Sheet1").Range("a1:A10")

myStr = ""
For Each myCell In myAddrRng.Cells
myStr = myStr & "," & myCell.Value
Next myCell

myStr = Mid(myStr, 2)

URL = "mailto:" & myStr & "?subject=Hi there"

ThisWorkbook.FollowHyperlink Address:=URL

End Sub




elf27 wrote:

Hello,

I've searched the forums and reviewed http://www.rondebruin.nl but I can't
seem to find an answer to a simple question.

I want a macro to email persons in a range and have a custom subject line
but I do not rely on them using outlook. If it's possible, I'd basically like
the equivalent of

mailto:[ARRAY]?subject=Item [VARIABLE X] Posted Online

Any way to do that?


--

Dave Peterson

Ron de Bruin

Email with mailto equivalent
 
For the OP

See also this page
http://www.rondebruin.nl/mail/oebody.htm



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm




"Dave Peterson" wrote in message ...
Maybe something like:

Option Explicit
Sub testme()

Dim myAddrRng As Range
Dim URL As String
Dim myStr As String
Dim myCell As Range

Set myAddrRng = Worksheets("Sheet1").Range("a1:A10")

myStr = ""
For Each myCell In myAddrRng.Cells
myStr = myStr & "," & myCell.Value
Next myCell

myStr = Mid(myStr, 2)

URL = "mailto:" & myStr & "?subject=Hi there"

ThisWorkbook.FollowHyperlink Address:=URL

End Sub




elf27 wrote:

Hello,

I've searched the forums and reviewed http://www.rondebruin.nl but I can't
seem to find an answer to a simple question.

I want a macro to email persons in a range and have a custom subject line
but I do not rely on them using outlook. If it's possible, I'd basically like
the equivalent of

mailto:[ARRAY]?subject=Item [VARIABLE X] Posted Online

Any way to do that?


--

Dave Peterson

__________ Information from ESET Smart Security, version of virus signature database 3972 (20090328) __________

The message was checked by ESET Smart Security.

http://www.eset.com




__________ Information from ESET Smart Security, version of virus signature database 3972 (20090328) __________

The message was checked by ESET Smart Security.

http://www.eset.com





All times are GMT +1. The time now is 07:12 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com