Emails from Access

R

Rick Brandt

Rockn said:
It is using the SendObject in VBA and cuts it off at 255 charachters.
He will experience the same thing.

Just tried it with a recipient list 5276 characters long. Worked just fine.
 
B

Bald Eagle

I posted a reply over half an hour ago - but it hasn't appeared in the
discussion group window yet. Maybe the system thinks that I have got enough
help!

Just in case that reply has got lost in the ether somewhere I will try again!
I have now got an email form opened in Outlook Express with all my email
addresses. Just one problem! Each email address is followed by '#Mailto:'
followed by a repeat of the email address and ending with another '#'. As a
result the email addresses are not recognised. Where did this add-on appear
from & how can I get rid of it?

It's now almost midnight here in Northern Ireland so I am off to bed!! I
look forward to getting the final piece of the jigsaw in the morning!
 
R

Rick Brandt

Bald said:
I posted a reply over half an hour ago - but it hasn't appeared in the
discussion group window yet. Maybe the system thinks that I have got
enough help!

Just in case that reply has got lost in the ether somewhere I will
try again! I have now got an email form opened in Outlook Express
with all my email addresses. Just one problem! Each email address
is followed by '#Mailto:' followed by a repeat of the email address
and ending with another '#'. As a result the email addresses are not
recognised. Where did this add-on appear from & how can I get rid of
it?

It's now almost midnight here in Northern Ireland so I am off to
bed!! I look forward to getting the final piece of the jigsaw in the
morning!

The SendObject function and Outlook Express expect standard text Email
addresses. What you have are Email Hyperlinks (never use em'). I assume
that there is a way to extract the text of the Email address from the
hyperlink, but I am unfamiliar with them.
 
A

Apprentice

What a great Post!

I am using this code successfully and want to add a few bells and whistles.

1. I want the email to go out to only the current record, and not the
entire query. I think I can do this by just modifing the query.... Is that
the best way to approach this. I have several email address under one record.

2. I would also like to use this code in conjuction with an automatic email
based on a date field. Any suggestions?

Here is my current code:

Dim db As Database
Dim rs As Recordset
Dim ToVar As String
Dim sql As String
sql = "SELECT Team_Leader_Email FROM EmailTestCharterHeader"
Set db = CurrentDb
Set rs = db.OpenRecordset(sql, dbOpenSnapshot)

Do Until rs.EOF
ToVar = ToVar & rs!Team_Leader_Email & ";"
rs.MoveNext
Loop

DoCmd.SendObject acSendNoObject, , , ToVar,,,"Charter Notification","Your
Charter has been recently updated",True
 
A

Apprentice

Repost.....

What a great Post!

I am using this code successfully and want to add a few bells and whistles.

1. I want the email to go out to only the current record, and not the
entire query. I think I can do this by just modifing the query.... Is that
the best way to approach this. I have several email address under one record.

2. I would also like to use this code in conjuction with an automatic email
based on a date field. Any suggestions?

Here is my current code:

Dim db As Database
Dim rs As Recordset
Dim ToVar As String
Dim sql As String
sql = "SELECT Team_Leader_Email FROM EmailTestCharterHeader"
Set db = CurrentDb
Set rs = db.OpenRecordset(sql, dbOpenSnapshot)

Do Until rs.EOF
ToVar = ToVar & rs!Team_Leader_Email & ";"
rs.MoveNext
Loop

DoCmd.SendObject acSendNoObject, , , ToVar,,,"Charter Notification","Your
Charter has been recently updated",True
 
P

pgillis

The EditMessage argument for SendObject does not seem to be working for me if
I try to set it to False. I know I am defining it correctly because the
VBAeditor corrected the spelling for me on the 9th argument. Has there been
an update to disable this option for security reasons?
 
D

Daniel

Rick Brandt said:
Dim db As Database
Dim rs As Recordset
Dim ToVar As String
Dim sql As String
sql = "SELECT EmailAddress FROM TableName"
Set db = CurrentDb
Set rs = db.OpenRecordset(sql, dbOpenSnapshot)

Do Until rs.EOF
ToVar = ToVar & rs!textField & ";"
rs.MoveNext
Loop

DoCmd.SendObject acSendNoObject, , , ToVar,,,"Subject","Message",True

I have implemented this code and it works perfectly except when there are
blank email addresses. how would i go about handling the blank fields?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top