sending emails using REALbasic

Joined
Apr 7, 2011
Messages
1
Reaction score
0
Points
1
Hi,

I have started using a MacBook a couple of weeks ago at my new job and I'm still getting used to it.
This is my first experience using a apple product and I'm finding it awesome :)

Now, about my problem:
I need to send hundred of emails per day and I'm wasting most of my time doing copy-paste from a excel file to a new e-mail.
I created templates for every type of e-mail I need to send, but some of the information have to change depending on the client, eg. clients name, email address, hotel...

I really don't know how to do it... I was thinking in creating a macro.... and indeed I tried... but let's be honest I can barely program VB how can I do it with RB??

Well, any help or idea would be appreciated.

This is what I have so far.... (macro using VB language):

Sub SendEMail()
Dim Email As String, Subj As String
Dim Msg As String, URL As String
Dim r As Integer, x As Double
For r = 2 To 3 'data in rows 2-3
' Get the email address
Email = Cells(r, 2)

' Message subject
Subj = "CompanyX Login Information"

' Compose the message
Msg = ""
Msg = Msg & "Dear " & Cells(r, 1) & "," & vbCrLf & vbCrLf
Msg = Msg & "I am pleased to inform you that ..."
Msg = Msg & Cells(r, 3).Text & "." & vbCrLf & vbCrLf
Msg = Msg & "Thank you" & vbCrLf
Msg = Msg & "Best Regards," & vbCrLf
Msg = Msg & "Meee"

' Replace spaces with %20 (hex)
Subj = Application.WorksheetFunction.Substitute(Subj, " ", "%20")
Msg = Application.WorksheetFunction.Substitute(Msg, " ", "%20")

' Replace carriage returns with %0D%0A (hex)
Msg = Application.WorksheetFunction.Substitute(Msg, vbCrLf, "%0D%0A")

' Create the URL
URL = "mailto:" & Email & "?subject=" & Subj & "&body=" & Msg

' Execute the URL (start the email client)
ShellExecute 0&, vbNullString, URL, vbNullString, vbNullString, vbNormalFocus

' Wait two seconds before sending keystrokes
Application.Wait (Now + TimeValue("0:00:02"))
Application.SendKeys "%s"
Next r
End Sub

Of course I get an error when trying to run it on my new MAC :/

Thanks a lot,
VT
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top