is there an app?

B

brother_bacon

that will automatically email a file from my pc to and email address at the
same time every day?
 
H

Howard

brother_bacon said:
that will automatically email a file from my pc to and email address
at the same time every day?

Assuming you're using windows, here's a VB script that I use to send an
email to my work to tell me my home IP address whenever my home pc reboots.
Easily hackable to make it do whatever you want it to do...

To use, copy the below text into a file with a .vbs extention, and then set
up a Windows Task to run it at what ever frequency you want.

'//////////////////////
'//
'// Send SMTP Mail messsage via VBScript.
'// 12/09/02
'//
'// Written by: Nathan Strimling
'//
'// Description: This script will send an email message via smtp without
'// the need for a smtp application such as blat.exe, etc.
'//
'// Intended Usage: SMTP messaging.
'//
'// Dependencies:
'//
'// Caution & Other Notes: This has only been tested under Win2k. Items
'//
'//
'// Modification History:
'//
'// Developer Date Description of Changes
'// ------ ---- ------------
'//
'//
'//////////////////////

'// Set the visual basic constants as they do not exist within VBScript.
' Do not set your smtp server information here.

Const cdoSendUsingMethod = _
"http://schemas.microsoft.com/cdo/configuration/sendusing", _
cdoSendUsingPort = 2, _
cdoSMTPServer = "http://schemas.microsoft.com/cdo/configuration/smtpserver"

'// Generate the email with IP Addresses in
'// Written by Mr Scebe 2003

Dim sIPAddr

strComputer = "."

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

Set IPConfigSet = objWMIService.ExecQuery _
("Select IPAddress from Win32_NetworkAdapterConfiguration where
IPEnabled=TRUE")

For Each IPConfig in IPConfigSet
If Not IsNull(IPConfig.IPAddress) Then
For i=LBound(IPConfig.IPAddress) to UBound(IPConfig.IPAddress)
sIPAddr = sIPAddr & IPConfig.IPAddress(i) & vbcrlf
Next
End If
Next

'// End Mr Scebe's contribution
'// ----------------------------------------------------------------

'// Create the CDO connections.
Dim iMsg, iConf, Flds
Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
Set Flds = iConf.Fields

'// SMTP server configuration.

With Flds
.Item(cdoSendUsingMethod) = cdoSendUsingPort

'///////////////////////////////////////////////////////////////////////////
///////////////////////////
'// Set the SMTP server address here.
.Item(cdoSMTPServer) = "smtp.yourisp.com"
'///////////////////////////////////////////////////////////////////////////
///////////////////////////

.Update
End With

'// Set the message properties.

With iMsg
Set .Configuration = iConf

'///////////////////////////////////////////////////////////////////////////
///////////////////////////
'/ Set the recipient address:
.To = "(e-mail address removed)"
'///////////////////////////////////////////////////////////////////////////
///////////////////////////

'///////////////////////////////////////////////////////////////////////////
///////////////////////////
'/ Set the Sender address:
.From = "(e-mail address removed)"
'///////////////////////////////////////////////////////////////////////////
///////////////////////////

.Subject = "IP Address listing"
.TextBody = sIPAddr
End With

'// An attachment can be included.
'iMsg.AddAttachment Attachment

'// Send the message.
iMsg.Send
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top