Sending emails quietly?

What I need is some help regarding emails. I've made a debug routine that checks for a log file. If it exists then it is supposed to send this file quietly to me so I can understand what caused the crash. Now how do I go about sending the email?

Comments

  • [b][red]This message was edited by lionb at 2007-2-28 7:11:1[/red][/b][hr]
    : What I need is some help regarding emails. I've made a debug routine that checks for a log file. If it exists then it is supposed to send this file quietly to me so I can understand what caused the crash. Now how do I go about sending the email?
    :
    In VB 6 you can use CDO object (Microsoft CDO For Exchange 2000 or Microsoft CDO 1.21 Library in Project/Reference list). Something like that:
    [code]
    Dim objSendMail As New CDO.Message
    Dim strFilePathName As String
    strFilePathName = "C:/Logfile/LogFile1.log"
    With objSendMail
    .From = "[email protected]"
    .To = "[email protected]"
    .Body = "Log File is here!"
    .Subject = "Problem!"
    .AddAttachment (strFilePathName)
    .Importance = 1
    .Send
    End With

    Set objSendMail = Nothing

    End Sub
    [/code]
    To use that SMPT service must be run on machine where exe file will be resided.

  • Thanks I tried to use this code, but all I have is Microsoft CDO for Windows 2000, so there where some errors in the code but I seam to have straightened them out by now.

    I'm however get an error when trying to send the email. Most likely to be inflicted by the stetement below:

    : To use that SMPT service must be run on machine where exe file will be resided.
    :

    So how do I launch that on my computer under XP? Is it enough to activate Outlook for i/o traffic?

    Thanks in advance!
  • : I'm however get an error when trying to send the email. Most likely to be inflicted by the stetement below:
    :
    : : To use that SMPT service must be run on machine where exe file will be resided.
    : :
    Not exactly. If SMTP is not running, message won't be sent without any error/warning. To run SMTP go to:
    Control Panel-Administrative Tools-Internet Information Services-Computername(local computer) - [b]Right click[/b] on Default SMTP Virtual Server -Start

    What Error did you get? Post your code and highlight line where Error appeared.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories