web 2.0


Sending e-mail using WinXP Pro SMTP service

This short tip shows how to use Windows SMTP service to send an e-mail. This will stop the annoying message from Outlook saying someone is trying to access its resources. It applies to MS Office as a whole…

Sub sendMail()

    Dim email As Object 

    Msg = "This is a test message using WinXP Pro SMTP service..."

    Set email = CreateObject("CDO.Message")

    With email
        .AddAttachment ActiveWorkbook.Path & "\fileName.xls"
        .From = "someone@somewhere.com"
        .To = "anyone@anywhere.com"
        '.CC = "noone@nowhere.com"
        '.BCC = "
joe.blog@joeyblogs.au"
        .Subject = "This message was generate on " & Date
        .TextBody = Msg
        .Send
    End With

    Set email = Nothing

End Sub
 

Comments

Comments are closed