Problem with sending mail


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Problem with sending mail

  1. #1
    Zoe Muzak Guest

    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-----



  2. #2
    Dean Earley Guest

    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
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center