Email individuals Info

gsbatch1

Registered User.
Local time
Today, 08:28
Joined
Dec 28, 2010
Messages
45
RESOLVED !!!!! Email individuals Info

I have a quick question.

I am using the following code to send the contents of a record set row to email addresses in the contents of a different row.

Set rstAM = New ADODB.Recordset
rstAM.CursorLocation = adUseClient
rstAM.Open "Select * From tblTest", _
CurrentProject.Connection, adOpenKeyset, adLockOptimistic

Dim r1, r2, r3 As String

Do While Not rstAM.EOF
r1 = rstAM![EmpName]
r2 = rstAM![Email Address]
r3 = rstAM![Prim Bucket]

DoCmd.SendObject , "", "", _
r2, "", "", Hello, _
Chr(13) & r1 & Chr(13) & " You are selecting " & r3 & Chr(13) & Chr(13) & "Than You," & Chr(13) & "Management" & vbCrLf & vbCrLf, True, ""
rstAM.MoveNext
Loop

The below is what appears in the "To:" section
Greg_Batchelor@xxx.xxxx.xxx#mailto:Greg_Batchelor@xxx.xxxx.xx#

It doubles up the recipient.
Any reason or fixes for this?
 
Last edited:
What is the data type of the Email Address field? I'm guessing Hyperlink, which I've seen do this type of thing. I just use plain text data types to hold email address, web address, etc.
 
That was it...Making it a text only field resulted in:
Greg_Batchelor@xxx.xxxx.xxx#mailto:Greg_Batchelor@ xxx.xxxx.xx#

in the cell. So I just went in and made the Address text and deleted the excess info


THANK YOU.
 
And just a quick explanation of why it was like that for hyperlink. Hyperlinks have two parts - the actual link (which is the mailto:Somebody@Somewhere.com) and the DISPLAY LABEL which can be different from the hyperlink, but in your case it was the same as it was added that way and not changed to just Greg Batchelor.
 

Users who are viewing this thread

Back
Top Bottom