Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Email from Access through Pegasus mail

56 views
Skip to first unread message

Mike Preston

unread,
Aug 13, 2001, 12:15:59 PM8/13/01
to
I have just started to analyze the ability of Access to send email
directly through my email client. I use Pegasus mail and I must
confess that I am finding the whole process somewhat trivial. I am
kicking myself for not having done this long ago.

I think I'm going to start responding to posts that ask how to send
email from Access with a comment that they consider adding Pegasus
just for the ability to automate email transmission. Pegasus is free,
and very lightweight in the sense that it doesn't muck around with the
registry very much, if at all (I think it adds 3 keys that are
benign).

If Tony T. sees this message I would recommend that his site be
updated with a suggestion along these lines. I know that his site
hints at it with:

"4.) Use direct object manipulation of your favorite email
application. Eudora does this okay (it exposes a set of classes you
can use to manipulate the program), haven't tried with Outlook or
Exchange. "

I suggest just adding a direct reference to Pegasus and the fact that
it is free. Pegasus' implementation might be arcane (DDE) and not
terribly robust, but it seems functional.

Just wanted to share. I'm sort of jazzed.

OK, Monday morning. {crack} The boss (wife) says get back to
work....

mike

Don P. Mellon

unread,
Aug 13, 2001, 12:29:17 PM8/13/01
to
This might be good news for people who don't have Outlook or Exchange;
otherwise, I don't see much point in using "Pegasus." However, if you would
explain what you mean by "just for the ability to automate email
transmission," maybe I would change my mind. (Using DDE is still hard to
swallow, though.)

I am surprised to learn that "Tony T." says he hasn't tried object
manipulation of Outlook or Exchange. Or was that "Tony the Tiger"?

--
Don P. Mellon
Take the pig out of my wigwam, please.

REPENT NOW! THERE IS LIFE AFTER ACCESS 97!

= = = = =

"Mike Preston" <mbpatpas...@pacbell.net> wrote in message
news:3b77f75b....@news.CIS.DFN.DE...

Mike Preston

unread,
Aug 13, 2001, 12:38:32 PM8/13/01
to
Click on an Access command button with caption set to:

SEND EMAIL

No other buttons need be pressed. Email is sent. It can all be
handled programatically. Pegasus can coexist with M$Outlook (yuck) or
Eudora. You can leave your defaults set to invoke the other email app
so the addition of Peg doesn't interfere with anything. It's memory
footprint is extremely small, as it its disk space footprint.

I shied away from DDE a while back when I was running a slower
computer. Now, it is fast enough that I don't even notice a
hesitation.

mike

Larry Linson

unread,
Aug 13, 2001, 3:25:07 PM8/13/01
to
You've been around long enough, Mike, that I don't suspect you of spamming.
So, are you going to post a link, or are we going to have to go to our
favorite search engine to find where Pegasus mail lives?

"Mike Preston" wrote

Mike Preston

unread,
Aug 13, 2001, 4:31:57 PM8/13/01
to
Larry. I know that you know that I wouldn't be spamming. Two way
meaning, too. In the newsgroup, which I'm pretty sure my message
doesn't count as such! And by using the product, which is sort of
controlled by my ISP, which doesn't allow relaying. I *could* get
around the ISP's initial wall via utilization of my own email server
(which I also have installed), but my ISP is so intolerant of spam
that I *know* that wouldn't last very long. Besides, who would be
interested in actuarial spam? Truly an exercise in futility. ;-)

I think the number of messages asking how to email from Access is a
consistently high (relative) number. Certainly Tony's site is a
welcome repository of email options and is referenced frequently.

There are others that have admitted using Pegasus. I know I'm not
alone.

The site is: www.pmail.com. The current version is 3.12(c). Version
4.0 is rumoured to be right around the corner, but I'll believe it
when I see it. And I probably won't upgrade for a long while, at
least until others have stumbled into the inevitable bugs.

mike

Don P. Mellon

unread,
Aug 13, 2001, 5:11:06 PM8/13/01
to
"I think the number of messages asking how to email from Access is a
consistently high (relative) number."

True, but a good portion of those posts concern problems with using
SendObject() in Access 2000, which is totally !#$%^& up and fully documented
as such. A one-shot email from Access is not a big deal. Looping through
records and picking up addresses is a little more complicated. Outputting
an indefinite number of reports or other Access objects and attaching them
to an indefinite number of emails is another level of complexity again. Yet
all of those operations and much more can be done using Automation code and
Outlook.

I am doubtful a shareware program can handle all of those situations.

--
Don P. Mellon
Take the pig out of my wigwam, please.

REPENT NOW! THERE IS LIFE AFTER ACCESS 97!

= = = = =

"Mike Preston" <mbpatpas...@pacbell.net> wrote in message

news:3b78332d....@news.CIS.DFN.DE...

Mike Preston

unread,
Aug 13, 2001, 5:24:14 PM8/13/01
to
On Mon, 13 Aug 2001 15:11:06 -0600, "Don P. Mellon"
<pig...@3rivers.net> wrote:

>"I think the number of messages asking how to email from Access is a
>consistently high (relative) number."
>
>True, but a good portion of those posts concern problems with using
>SendObject() in Access 2000, which is totally !#$%^& up and fully documented
>as such. A one-shot email from Access is not a big deal. Looping through
>records and picking up addresses is a little more complicated. Outputting
>an indefinite number of reports or other Access objects and attaching them
>to an indefinite number of emails is another level of complexity again. Yet
>all of those operations and much more can be done using Automation code and
>Outlook.
>
>I am doubtful a shareware program can handle all of those situations.

One point of clarification. It is not shareware. It is freeware.

Sending Access objects themselves is not likely to be supported. I
don't see a particularly big demand for that, though. Completed
reports, OTOH, are prime email material. Unless those can be forced
into a regular file, which can then be attached to an email, I don't
see any non-M$-based program filling the bill.

I can set up Access to automatically print a report to a pdf file. It
takes some doing, but I've never set it up before because I didn't
have the last piece to the puzzle: email from Access. I'm not saying
the entire implementation is necessarily trivial. But my system can
do it, now that I've figured out how to use my email client from
Access. The more difficult part is getting the file created from
within Access. The email part is now trivial to me.

mike

Don P. Mellon

unread,
Aug 13, 2001, 6:11:11 PM8/13/01
to
Actually, I failed to distinguish between attaching an Access object and
attaching a file generated from an Access object, such as when an Access
report is outputted as an RTF file. I have solved this problem--creating
the file and attaching it to an email--as follows:

1. Output the Access report in the desired file format to the system temp
folder or other temp folder created for this purpose. (I allow my user to
select the temp folder in a setup form.) This is the TargetFolder. So:

strTargetFolder = Forms!frmSetUp!txtTempPath

2. Next, programmatically create the path and file name from the document
the user selected:

strTargetFile = strTargetFolder & strDocName & ".rtf"

3. Output the Access report to the Target File:

DoCmd.OutputTo acOutputReport, strDocName, acFormatRTF, strTargetFile

4. Attach the file to the Outlook message (With block--global object
variable not shown):

Set golAttach = .Attachments.Add(strTargetFile)

5. Go back and delete the temporary file.

Kill strTargetFile


At Step 4, all you would have to do is to direct Pegasus to attach the file
it finds in the temp folder. Thus, "the more difficult part" of creating
the file from within Access is solved, and everything becomes "trivial"!

--
Don P. Mellon
Take the pig out of my wigwam, please.

REPENT NOW! THERE IS LIFE AFTER ACCESS 97!

= = = = =

"Mike Preston" <mbpatpas...@pacbell.net> wrote in message

news:3b78435e....@news.CIS.DFN.DE...

Mike Preston

unread,
Aug 13, 2001, 7:35:11 PM8/13/01
to
On Mon, 13 Aug 2001 22:57:21 GMT, cdotg...@worldnet.att.net.invalid
(Chuck Grimsby) wrote:

>
>I don't know, Mike... Asking/Requiring some of my larger clients to
>have Pegasus on their systems in addition to Outlook would be rather
>problematical. I'm not sure how long they'd stay as my client!

No argument there. Pegasus is definitely not the solution for
everybody. And even though it doesn't need to be installed and
therefore would be easy to provide as a part of an installed app
(adding 5 meg to an installation these days is hardly noticeable), I
don't think that would satisfy the Pegasus license agreement.

>For situations where I =could= talk the client in to it perhaps, but
>usually if the client doesn't have Outlook or another MAPI compliant
>program, I resort to using SMTP. I've always known that the SMTP
>method would be a problem for a client who didn't have a 'always on'
>internet connection (Cable or DSL), but so far I've been lucky in that
>regard. When I have to resort to SMTP, the client has had a 'always
>on' connection.

OK, now I'm confused. Are you saying that you use native SMTP from
within Access to push an email onto a recipient's mail server? I know
that is what an email client does, but that requires coordination with
the IP access mechanism and a host of other things, like resolving
addresses to MX records from Domain Name Servers, that I wouldn't want
to touch. Or are you saying that you use one of the third party
controls, like those mentioned on Tony's web page, and they include
SMTP?

I admit to not having a firm grasp on MAPI compliance, either.
Perhaps because I've been so firmly rooted in POP3 and SMTP (at least,
what _I_ think of when I see SMTP, not necessarily what you are
referring to with SMTP, above).

Yours in confustion,

mike

Tony Toews

unread,
Aug 13, 2001, 11:19:10 PM8/13/01
to
mbpatpas...@pacbell.net (Mike Preston) wrote:

>If Tony T. sees this message I would recommend that his site be
>updated with a suggestion along these lines. I know that his site
>hints at it with:
>
>"4.) Use direct object manipulation of your favorite email
>application. Eudora does this okay (it exposes a set of classes you
>can use to manipulate the program), haven't tried with Outlook or
>Exchange. "
>
>I suggest just adding a direct reference to Pegasus and the fact that
>it is free. Pegasus' implementation might be arcane (DDE) and not
>terribly robust, but it seems functional.

Got sample code? Or links to sample VB code for the DDE stuff? I'll be happy to
add such info along with credit to you.

Tony
----
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm

Tony Toews

unread,
Aug 13, 2001, 11:19:09 PM8/13/01
to
"Don P. Mellon" <pig...@3rivers.net> wrote:

>I am surprised to learn that "Tony T." says he hasn't tried object
>manipulation of Outlook or Exchange. Or was that "Tony the Tiger"?

At that time. Also that comment was from a while back when I hadn't actually used
Exchange in a corporate environment. Now that I've seen it in action I realize that
you can't interact directly with Exchange but you must instead go through Outlook. Or
at least thats how I understand things.

I've since used some of the code for Outlook at one of my clients including getting
it working with late binding when a sysadmin at my clients decided to install Outlook
2000.

Time for an update of that page. Next week, maybe.

Mike Preston

unread,
Aug 14, 2001, 2:41:20 AM8/14/01
to
Tony,

I'll put something together and email it to you.

mike

On Tue, 14 Aug 2001 03:19:10 GMT, Tony Toews <tto...@telusplanet.net>
wrote:

Mike Preston

unread,
Aug 14, 2001, 7:29:22 AM8/14/01
to
Chuck,

Wow! Many thanks for that. A personal email server in a newsgroup
message. Yes, I knew that POP3 and SMTP just use text because I've
had to analyze text/log files to ascertain what is really going on
when communication fails.

I had no idea that one could so easily access winsock, however.

Not sure I'd want to add attachments. (No, that is not a request for
you to append to your code the mechanism for doing that.) And since
the majority of use I can see for emailing from Access would be to
attach reports, I think there will still be a need to interface with
an email client of some sort.

Or are you going to tell me that sending an attachment via SMTP is a
snap, too? I know what Pegasus does behind the scenes. It converts
the file into a MIME-compliant series of text lines and then wraps
those lines in a few headers. The header part is not complicated.
Shelling to a routine that can convert a file to lines of ascii text
would be the most effort, I suppose.

Thanks for the clarification.

mike

On Tue, 14 Aug 2001 11:03:15 GMT, cdotg...@worldnet.att.net.invalid
(Chuck Grimsby) wrote:

>Sorry for the confusion. Let me see if I can clear it up a bit by
>starting with a few terms.
>
>CDO ("Collaboration Data Objects") is the set of objects Outlook
>'exposes' to programmers for their use.
>MAPI ("Mail API") is a API Microsoft provides to programmers to send
>and receive mail.
>POP3 ("Post Office Protocol 3") is the set of signals used to retrieve
>mail.
>SMTP ("Simple Mail Transport Protocol") is the set of signals used to
>send mail.
>
>CDO and MAPI are Windows only. POP3 and SMTP are Internet standards.
>CDO and MAPI use POP3 and SMTP to do their work.
>
>The hidden 'dirty little secret' behind POP3 and SMTP is that they are
>all text commands! SEND, HELO, things like that.
>
>Maybry makes a excellent Mail control, and I understand AgSoft's is
>just as good, but you don't really need either. All you really need
>is WinSock.
>
>For SMTP, just connect to the server (by name, no need to figure out
>the IP address, or anything like that), Open port 25, and send the
>mail. Not all that difficult.
>
>Semi-Air code:
>
>Sub STMPSend(strMyDomain As String, _
> strEmailServer As String, _
> strEmailAddressWithoutDomain As String, _
> strWhoToSayThisIsFrom As String, _
> strSubject As String, _
> strMessageBody As String)
> WinSock1.RemoteHost = strEmailServer
> WinSock1.RemotePort = 25
> WinSock1.Connect
>
> WaitForIt
> Select Case Left$(strWSIn, 3)
> Case "220"
> ' connected ok, send HELLO
> WinSock1.SendData "HELO " & _
> strMyDomain & _
> vbCrLf
> WaitForIt
> WinSock1.SendData "MAIL FROM: " & _
> strWhoToSayThisIsFrom & _
> vbCrLf
> WaitForIt
> WinSock1.SendData "RCPT TO: " & _
> strWhoToSayThisIsFrom & _
> vbCrLf
> WaitForIt
> WinSock1.SendData "DATA" & vbCrLf & _
> "DATE:" & _
> Format$(Now(), "mm/dd/yyyy hh:mm:ss") & _
> "FROM: " & _
> strWhoToSayThisIsFrom & vbCrLf & _
> "TO:" & _
> Format$(Now(), "mm/dd/yyyy hh:mm:ss") & _
> "DATE:" & _
> Format$(Now(), "mm/dd/yyyy hh:mm:ss") & _
> "SUBJECT: " & _
> strSubject & _
> vbCrLf & _
> strMessageBody & _
> vbCrLf & _
> "." & vbCrLf
> ' note: . & vbcrlf terminates the "send"
> WaitForIt
> ' parse and validate the return from the sever
> End Select
> ' tell the server you're done:
> WinSock1.SendData "QUIT" & vbCrLf
> ' and that's it!
> WinSock1.Close
>End Sub
>
>Private Sub WaitForIt()
> WaitingForData = True
> While WaitingForData = True
> DoEvents
> Wend
>End Sub
>
>Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
> Dim Temp As String
> Temp = String(bytesTotal, " ")
> WinSock1.GetData Temp, vbString
> Do
> If Right$(Temp, 1) = vbLf Then
> Temp = Left$(Temp, Len(Temp) - 1)
> End If
> Loop While Right$(Temp, 1) = vbLf
> strWSIn = Temp
> WaitingForData = False
>End Sub
>
>
>---
> Who Is Art, And Why Does Life Imitate Him?

Mike Preston

unread,
Aug 14, 2001, 7:45:30 AM8/14/01
to
On Tue, 14 Aug 2001 03:19:10 GMT, Tony Toews <tto...@telusplanet.net>
wrote:

>Got sample code? Or links to sample VB code for the DDE stuff? I'll be happy to


>add such info along with credit to you.

How's this? Throw this into a module.... (I'll still email you this
in a form that hasn't been reformated to fit in the newsgroup without
word wrap).

Option Compare Database
Option Explicit
Public Function fPegSend(strNewMessage As String, _
strDefaults As String, _
strTo As String, _
strCC As String, _
strBCC As String, _
strSubject As String, _
ArrayData() As String, _
strInsertFile As String, _
ArrayAttachments() As String, _
strIdentity) As Boolean

''''''''''''''''''''''''''''''''''''''''''''''''''''
'Sample Access97 routine to send mail from Pegasus Mail v3.12
''''''''''''''''''''''''''''''''''''''''''''''''''''

'This code was originally written by Mike Preston. 14 Aug 2001
'It may be altered and/or distributed in any manner.
'You are free to use it in any application.
'No attribution is required.
'This routine has not been seriously stress tested.

'Code Courtesy of
'Mike Preston

'''*******************************************************************************************
''' SAMPLE DIRECT USAGE (SEE MORE COMPLETE EXAMPLE BENEATH CODE):
'''
''' Dim SendMailSuccess as Boolean
''' SendMailSuccess = _
'' fPegSend ("Y", _ 'Y=Message, <>Y =Window
''' "Y", _ 'Defaults option
''' "tto...@telusplanet.net", _ ' To: field
''' "", _ ' CC: field
''' "", _ ' BCC: field
''' "Test Mail with pdf", _ ' Subject: Field
''' usrData(), _ ' Data lines
''' "", _ ' File Insert
''' usrAttach(), _ ' File Attachments
''' "") ' Identity
'''Where: usrData(1)="Hi, Tony...."
'''usrData(2)="Here is the file we discussed."
'''usrData(3)="It is in pdf format, so there is no chance of a virus."
'''usrAttach(1)="c:\my documents\test.pdf"
'''usrAttach(2)="c:\my documents\test2.pdf"

'' Complete documentation of the DDE capabilities of WinPMail can be
'' found in the text file that ships with Pegasus and is typically
'' found in the \Pmail\Resource directory with the name:
'' WINPMDDE.TXT

'' This code sends a single message to the Pegasus application using
'' the Message DDE topic. There is no attempt to use either the
'' System, Environment or TCP topics. The actual sending of the email
'' is controlled by the queue options of Pegasus. You can extend
'' this code to control how the mail is sent using the TCP DDE topic.

'' The commands available, not all of which are implemented in this
'' example, are:

'' New : <"Message"> or <"Window">
'' Defaults: Y
'' To : <address> [, <address> ...]
'' Cc : <address> [, <address> ...]
'' Bcc : <address> [, <address> ...]

' Note: <address> may be any valid Pegasus address, including a
' mail distribution list.

'' Subject : <string>
'' Reply-to : <address>
'' Copyself : <'Y'> or <'N'>
'' Confirm-delivery : <'Y'> or <'N'>
'' Confirm-reading : <'Y'> or <'N'>
'' Urgent : <'Y'> or <'N'>
'' Encrypted : <encryptor-name><,><passphrase><,><flags>
'' Signature : <number>
'' Mime : <'Y'> or <'N'>
'' Attach : <path><,><filename><,><attachment-type><,><encoding>

' Note: Multiple Attach statements are allowed. Pegasus limits the
' number of attachments to 64

'' File : <filename>
'' Data : <String>

' Note: Only one file may be used. Multiple data statements may be
' inserted. The insertion of a data statement eliminates any file
' insertion from the resulting email. The logic of this routine
' checks for a file to be inserted. If it finds that a file has been
' specified, it does not insert any data statements, even if
' received.

'' Identity : <identity_name>
'' Volatile : <'Y'> or <'N'> (Default is 'Y')
'' Richtext : <'Y'> or <'N'> (Default is 'N')
'' Send
'' Restore

Dim LoopVar As Integer

strTo = "To: " & strTo
strCC = "Cc: " & strCC
strBCC = "Bcc: " & strBCC
strSubject = "Subject: " & strSubject
strIdentity = "Identity: " & strIdentity
'-------------
Dim channel As Long
On Error Resume Next

channel = DDEInitiate("WinPMail", "Message")
If Err.Number = 282 Then
' WinPMail not running
On Error GoTo ErrHandler
Dim WinPMailCmd As String
WinPMailCmd = "C:\pmail\winpm-32.exe -A -I mikep"
Shell WinPMailCmd, vbMinimizedFocus
channel = DDEInitiate("WinPMail", "Message")
Else
If Err.Number <> 0 Then
GoTo ErrHandler
End If
End If

'-------------
If strNewMessage = "Y" Then
DDEPoke channel, "Message", "New: Message"
Else
DDEPoke channel, "Message", "New: Window"
End If
'-------------
If strDefaults = "Y" Then
DDEPoke channel, "Message", "Defaults: Y"
End If
'-------------
DDEPoke channel, "Message", strTo
DDEPoke channel, "Message", strCC
DDEPoke channel, "Message", strBCC
DDEPoke channel, "Message", strSubject
'-------------
Dim Userubound As Integer
If Len(strInsertFile) > 1 Then
DDEPoke channel, "Message", "File: " & strInsertFile
Else
Userubound = UBound(ArrayData())
If Userubound = 0 Then
' nothing to do
Else
For LoopVar = 0 To Userubound - 1
DDEPoke channel, "Message", "Data: " & _
ArrayData(LoopVar)
Next LoopVar
End If
End If
'-------------
Userubound = UBound(ArrayAttachments())
If Userubound = 0 Then
' nothing to do
Else
For LoopVar = 0 To Userubound - 1
DDEPoke channel, "Message", "Attach: " & _
ArrayAttachments(LoopVar) & ",,-0"
Next LoopVar
End If
'-------------
DDEPoke channel, "Message", strIdentity
DDEPoke channel, "Message", "Send"
DDETerminate channel

fPegSend = True

ExitProcedure:
Exit Function

ErrHandler:
fPegSend = False
MsgBox "Error " & Err.Number & ": " & Err.Description, _
vbMsgBoxHelpButton, "Email DDE Error", Err.HelpFile, _
Err.HelpContext
Resume ExitProcedure

'''''*****************************************************************************
''''' Example usage - complete:

'' Sub cmdSendEmail()

'' Dim strTo As String
'' Dim strInsertFile As String
'' Dim strIdentity As String

'' strTo = "tto...@telusplanet.net"
'' strInsertFile = "c:\my documents\template1.txt"
'' strIdentity = ""

'' Dim usrData(3) As String
'' usrData(0) = "Hi, Tony...."
'' usrData(1) = "This is the file we spoke about."
'' usrData(2) = "It is a pdf file, so there is no chance of a
virus."

'' Dim usrAttach(2) As String
'' usrAttach(0) = "c:\my documents\test2.pdf"
'' usrAttach(1) = "c:\my documents\test.pdf"

'' Dim SendMailSuccess As Boolean
'' SendMailSuccess = fPegSend("Y", _
'' "Y", _
'' strTo, _
'' "", _
'' "", _
'' "Test Mail with pdf", _
'' usrData(), _
'' strInsertFile, _
'' usrAttach(), _
'' strIdentity)

'' If SendMailSuccess = True Then
'' ' Message sent successfully
'' MsgBox "Your mail to " & strTo & " has been delivered " & _
'' "to Pegasus Mail." & vbCrLf & "It will be " & _
'' "delivered by Pegasus in accordance with the " & _
'' "options you have selected in that program." _
'' , , "Email Successful!"
'' Else
'' MsgBox "Your mail to " & strTo & " failed." _
'' , , "Email Failed!"
'' ' Message failed
'' End If
'' Exit Sub
End Function

Don P. Mellon

unread,
Aug 14, 2001, 10:16:11 AM8/14/01
to
You wrote earlier in this thread: "I use Pegasus mail and I must

confess that I am finding the whole process somewhat trivial."

Surely you do not think the code example you have given below is "trivial"
or that it would be of any use to the average developer in his never-ending
quest to send email quickly and simply from Access?

--
Don P. Mellon
Take the pig out of my wigwam, please.

REPENT NOW! THERE IS LIFE AFTER ACCESS 97!

= = = = =

"Mike Preston" <mbpatpas...@pacbell.net> wrote in message

news:3b790b98....@news.CIS.DFN.DE...

Don P. Mellon

unread,
Aug 14, 2001, 10:37:00 AM8/14/01
to
There is a lot of confusion in this thread--and in this newsgroup--about CDO
versus the Outlook Object Library, what each technology does and when to use
one or the other. Search "CDO" in the MSDN Library for a wealth of articles
on the subject.

--
Don P. Mellon
Take the pig out of my wigwam, please.

REPENT NOW! THERE IS LIFE AFTER ACCESS 97!

= = = = =

"Tony Toews" <tto...@telusplanet.net> wrote in message
news:4pqgnt8mc6moknk5j...@4ax.com...

Mike Preston

unread,
Aug 14, 2001, 12:55:29 PM8/14/01
to
On Tue, 14 Aug 2001 08:16:11 -0600, "Don P. Mellon"
<pig...@3rivers.net> wrote:

>You wrote earlier in this thread: "I use Pegasus mail and I must
>confess that I am finding the whole process somewhat trivial."
>
>Surely you do not think the code example you have given below is "trivial"
>or that it would be of any use to the average developer in his never-ending
>quest to send email quickly and simply from Access?

What is the expression? Oh, yeah....Don't call me Shirley!

Actually, I do. To both. You drop as few as 3 values (to, subject,
one other: either insert file name or data item) into a simple
function call and an email has been generated. Add a fourth
(attachment filename) and you have sent an email with an attachment.

The neat thing about the Pegasus DDE exposure is that you can, if you
want, use its address book functions so that by dropping those 4 items
you can generate an easy email to all of your clients,
programmatically, with information from your database.

Combine the above with your already shown and appreciated code on how
to create a file from an access report and the power is fairly
awesome. Especially if one has clients that have a desire for
periodic information from one's database. In this case, clients can
be a subset of managers that would like statistics on project
completions, etc.

If one swims past the comment lines, which I admit I went overboard
with, you will find absolutely nothing of substance! OK, maybe one
item where I looked up the error code for not having the DDE service
available, trapped for it and started the progrma to make it
available. Maybe I should do a non-function version that one could
just drop into a form behind a button that relies on specific text
boxes. Without comments I'd be surprised if it was more than 40 lines.
Hmmm... next week I think. So, comparitively speaking, I'm still
inclined to vote for trivial.

mike


Don P. Mellon

unread,
Aug 14, 2001, 2:37:55 PM8/14/01
to
One man's trivial is another man's travail.

If you make your function available to Access/Pegasus users, and you go
ahead and write up a little universal routine for Access forms, then I think
nobody will care "how it works," since you have done all the work for them.

--
Don P. Mellon
Take the pig out of my wigwam, please.

REPENT NOW! THERE IS LIFE AFTER ACCESS 97!

= = = = =

"Mike Preston" <mbpatpas...@pacbell.net> wrote in message

news:3b7953c6....@news.CIS.DFN.DE...

Mike Preston

unread,
Aug 14, 2001, 8:16:23 PM8/14/01
to
Now you want a form? Sheesh.... ;-)

I haven't given this enough thought to determine precisely how I want
to integrate this into my current app. Once that is done, I might end
up with a form along the lines you mention. I might not. If'n I do,
I'll let you know.

mike

Tony Toews

unread,
Aug 15, 2001, 1:44:09 AM8/15/01
to
"Don P. Mellon" <pig...@3rivers.net> wrote:

>Yet
>all of those operations and much more can be done using Automation code and
>Outlook.

Or third party controls such as www.mabry.com which directly access POP3/SMTP servers
if you don't want to assume that Outlook resides on the system and/or that it's
configured properly and/or doesn't have some security updates installed and/or is
mucked up in some wierd way and/or doesn't run out of resources and/or ... but you
get the idea.

Tony Toews

unread,
Aug 15, 2001, 1:44:10 AM8/15/01
to
cdotg...@worldnet.att.net.invalid (Chuck Grimsby) wrote:

>For situations where I =could= talk the client in to it perhaps, but
>usually if the client doesn't have Outlook or another MAPI compliant
>program, I resort to using SMTP.

Agreed

>I've always known that the SMTP
>method would be a problem for a client who didn't have a 'always on'
>internet connection (Cable or DSL), but so far I've been lucky in that
>regard. When I have to resort to SMTP, the client has had a 'always
>on' connection.

Just tell them to manually connect to the Internet via their dialer program or run a
RAS (dialer) control or do a direct API call, for which I forget the details, to
invoke the dialer.

Tony Toews

unread,
Aug 15, 2001, 1:44:11 AM8/15/01
to
mbpatpas...@pacbell.net (Mike Preston) wrote:

>I had no idea that one could so easily access winsock, however.

I'll shortly be writing an app where I'll probably be ignoring the Winsock control
and going directly into the API calls. It is nice though.

I found the following URL to be quite impressive in it's tutorial.
http://www.snible.org/winsock/ Windows Sockets Programming

>Or are you going to tell me that sending an attachment via SMTP is a
>snap, too? I know what Pegasus does behind the scenes. It converts
>the file into a MIME-compliant series of text lines and then wraps
>those lines in a few headers. The header part is not complicated.
>Shelling to a routine that can convert a file to lines of ascii text
>would be the most effort, I suppose.

I don't think attachments are quite that easy as you need to convert them somehow but
I didn't need to worry about that capability so I've ignored it.

Tony Toews

unread,
Aug 15, 2001, 1:44:11 AM8/15/01
to
"Don P. Mellon" <pig...@3rivers.net> wrote:

>You wrote earlier in this thread: "I use Pegasus mail and I must
>confess that I am finding the whole process somewhat trivial."
>
>Surely you do not think the code example you have given below is "trivial"
>or that it would be of any use to the average developer in his never-ending
>quest to send email quickly and simply from Access?

Actually it looks like fairly complete and standard code for this kinda stuff.
Including the DDE stuff which I've had to work with. And I'm comparing this to code
required for Mabry and CDO.

Tony Toews

unread,
Aug 15, 2001, 1:44:12 AM8/15/01
to
mbpatpas...@pacbell.net (Mike Preston) wrote:

>If one swims past the comment lines, which I admit I went overboard
>with, you will find absolutely nothing of substance!

Hogwash. No programmer ever went overboard in comment lines. <chuckle>

Gary Rockley

unread,
Aug 15, 2001, 1:52:26 AM8/15/01
to

Tony Toews wrote:
>
> mbpatpas...@pacbell.net (Mike Preston) wrote:
>
> >If one swims past the comment lines, which I admit I went overboard
> >with, you will find absolutely nothing of substance!
>
> Hogwash. No programmer ever went overboard in comment lines. <chuckle>

I recently needed some old code which I had written a couple of years
ago. After I finally found the mdb and the function, I could not make
heads or tails of it. The only comment was:

'You are gonna regret this if don't add comments now.

Gary

Marshall Barton

unread,
Aug 15, 2001, 10:41:10 AM8/15/01
to
ROFLOL

Priceless!

Marsh


Gary Rockley wrote in message
<3B7A0D6F...@mn.mediaone.net>...

Tony Toews

unread,
Aug 15, 2001, 11:30:31 AM8/15/01
to
Gary Rockley <g...@mn.mediaone.net> wrote:

>> Hogwash. No programmer ever went overboard in comment lines. <chuckle>
>
>I recently needed some old code which I had written a couple of years
>ago. After I finally found the mdb and the function, I could not make
>heads or tails of it. The only comment was:
>
>'You are gonna regret this if don't add comments now.

<chuckle>

Michael Motek

unread,
Aug 15, 2001, 5:18:38 PM8/15/01
to
But not so priceless when it's some other lazy sod in your organization
who wrote the thing and you are stuck with the maintenance!

In article <9le1hn$p34$1...@slb2.atl.mindspring.net>,
marsh...@Mindspring.com says...

--
Michael Motek
Senior Programmer/Analyst, University of Victoria

Tony Toews

unread,
Aug 15, 2001, 7:05:59 PM8/15/01
to
Michael Motek <mmo...@nix.the.spam.uvic.ca> wrote:

>But not so priceless when it's some other lazy sod in your organization
>who wrote the thing and you are stuck with the maintenance!

Ouch. I pretty much do my own mtce on my own code so I can only curse myself.

Marshall Barton

unread,
Aug 15, 2001, 10:07:13 PM8/15/01
to
Amen to that!

But it's true justice when one does it to oneself.

Only a mind like Lyle's can get away with it ;-)
(Not to imply that there is another mind like Lyle's)

Marsh


Michael Motek wrote in message ...

Michael Motek

unread,
Aug 16, 2001, 1:01:06 PM8/16/01
to
In article <l60mntooi6c04oa03...@4ax.com>,
tto...@telusplanet.net says...

> Michael Motek <mmo...@nix.the.spam.uvic.ca> wrote:
>
> >But not so priceless when it's some other lazy sod in your organization
> >who wrote the thing and you are stuck with the maintenance!
>
> Ouch. I pretty much do my own mtce on my own code so I can only curse myself.

Yes, it boggles my mind why this person is our supervisor's "golden
child" who can do nothing wrong. We've pointed out the lack of both
comments and documentation time after time to no avail...

> Tony
> ----
> Tony Toews

Don P. Mellon

unread,
Aug 16, 2001, 1:45:47 PM8/16/01
to
"Yes, it boggles my mind why this person is our supervisor's "golden
child" who can do nothing wrong."

***
Translation Follows:

"person" = minority, woman. The word is assumed to be gender-neutral by
some writers because there is no opposite word, such as "perdaughter."

"golden child" = favorite female; gender-neutral term used to replace the
traditional "golden boy."

"who can do nothing wrong" = protected minority status. The employee was
hired under an affirmative action program and cannot be held to normal
standards of job performance.

--
Don P. Mellon
(Email wigwam not pigwam)
=============================
"The Howling," brought to you by
Dell Power Supply Fans. Now playing
everywhere.
=============================


"Michael Motek" <mmo...@nix.the.spam.uvic.ca> wrote in message
news:MPG.15e59c289...@news.uvic.ca...

0 new messages