Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need a little email help ...

Status
Not open for further replies.

BrooksR

Programmer
Feb 24, 2001
98
US
I'm an experienced VBA developer with little knowledge of GW. I'm having partial success with the following code, which I found on GW's website. The email address resolves, a valid message ID is issued, the email shows up in the sent box, but the recipient never receives the message.

You can see that I tried 3 variations on the recipient's name. They all resolve, but are not delivered. What am I doing wrong?

Thanks!

Dim objApp As Application2
Dim objAccount As Account
Dim objDraftMsg As Message
Dim objSentMsg As Message
Dim objRecip As Recipient

Set objApp = CreateObject("NovellGroupWareSession")
' Tried both ways
'Set objAccount = objApp.Login("", "")
Set objAccount = objApp.Login("username", "password")

CommandSendMail.Enabled = True

Set objDraftMsg = objAccount.WorkFolder.Messages.Add ' create draft in work folder

objDraftMsg.Subject = "test at " & Now

objDraftMsg.BodyText = "this is a test"

' Tried all 3
Set objRecip = objDraftMsg.Recipients.Add("firstname.lastname@companyname.com", egwTo) ' to self
'Set objRecip = objDraftMsg.Recipients.Add("Lastname, Firstname", egwTo) ' to self
'Set objRecip = objDraftMsg.Recipients.Add("Firstname Lastname", egwTo) ' to self

Call objRecip.Resolve
If objRecip.Resolved <> egwResolved Then
MsgBox &quot;Did not resolve&quot;
Else
MsgBox &quot;Resolved ok&quot;
End If

Set objSentMsg = objDraftMsg.Send
MsgBox objSentMsg.MessageID
' Thought these might help, but they didn't
'objSentMsg.Refresh
'objAccount.Refresh

Set objDraftMsg = Nothing
Set objAccount = Nothing
Set objApp = Nothing
 
Michigan:

Thanks! The 2nd link was particularly helpful.

Brooks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top