-
Problem with sending mail
I'm using VB5 Sp3 and Outlook 2000
The code at the end of this message sends an e-mail message and works fine
on my machine.
I gave the program to a co-worker to work on and the program sent the mail
through outlook, but she immeadeatly recieved an undeliverable mail message.
Why would this work on my machine, but not hers? Any help would be greatly
appriecated.
TIA,
~Zoe
'------- code snip-----
Dim oOutlook As Outlook.Application
Dim oMail As MailItem
Dim address As String 'holds e-mail address
Dim letter As String 'holds body of message
'collect correct e-mail address to send
Brad = "Select email from emails where area = '" & txtHall.Text & "'"
Set rs = db.OpenRecordset(Brad)
rs.MoveFirst
rs.MoveLast
address = rs![email]
'construct body of message
letter = "The following requested action, " & txtDetails.Text & ", for "
'if txthall.Text (is a residence hall)
'then place room number in "room ### of "
If txtRoom.Text <> "N/A" Then
letter = letter & "room " & txtRoom.Text & " of "
End If
letter = letter & txtHall.Text & " has been completed."
Set oOutlook = New Outlook.Application
Set oMail = oOutlook.CreateItem(olMailItem)
With oMail
.Recipients.Add address
.Recipients.ResolveAll
.Subject = "Requested Maintenance Service Completed"
.Body = letter 'message goes here
.Send
End With
MsgBox "Message Sent"
'-----end code snip-----
-
Re: Problem with sending mail
If you are using resolveall, I assume you are using their name, not their
address. Is that entry in her addressbook?
--
Dean Earley (dean.earley@icode.co.uk)
Assistant Developer
iCode Systems
"Zoe Muzak" <lavlamp@win.bright.net> wrote in message
news:3a797aab$1@news.devx.com...
> I'm using VB5 Sp3 and Outlook 2000
> The code at the end of this message sends an e-mail message and works fine
> on my machine.
> I gave the program to a co-worker to work on and the program sent the mail
> through outlook, but she immeadeatly recieved an undeliverable mail
message.
>
> Why would this work on my machine, but not hers? Any help would be
greatly
> appriecated.
>
> TIA,
> ~Zoe
>
> '------- code snip-----
> Dim oOutlook As Outlook.Application
> Dim oMail As MailItem
> Dim address As String 'holds e-mail address
> Dim letter As String 'holds body of message
> 'collect correct e-mail address to send
> Brad = "Select email from emails where area = '" & txtHall.Text & "'"
> Set rs = db.OpenRecordset(Brad)
> rs.MoveFirst
> rs.MoveLast
> address = rs![email]
> 'construct body of message
> letter = "The following requested action, " & txtDetails.Text & ", for
"
> 'if txthall.Text (is a residence hall)
> 'then place room number in "room ### of "
> If txtRoom.Text <> "N/A" Then
> letter = letter & "room " & txtRoom.Text & " of "
> End If
> letter = letter & txtHall.Text & " has been completed."
> Set oOutlook = New Outlook.Application
> Set oMail = oOutlook.CreateItem(olMailItem)
> With oMail
> .Recipients.Add address
> .Recipients.ResolveAll
> .Subject = "Requested Maintenance Service Completed"
> .Body = letter 'message goes here
> .Send
> End With
> MsgBox "Message Sent"
> '-----end code snip-----
>
>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks