Login | |
|
 |
RE: Sending E-Mails - 3/25/2007 9:21:16 PM
|
|
 |
|
| |
ginolard
Posts: 1044
Score: 21
Joined: 8/10/2005
Status: offline
|
You don't need to know the port that's not what the cdosendUsingport setting means. It just means, effectively, "send using the default SMTP port". Leave it as 2. XP shouldn't complain about it as you aren't using Outlook to send the file (whereas it might complain if you wrote a similar script in Outlook VBA).
_____________________________
Author of ManagePC - http://managepc.net AD Query Template - http://www.visualbasicscript.com/m_40609/tm.htm Consolidated Scripting Framework - http://www.visualbasicscript.com/m_59109/tm.htm
|
|
| |
|
|
|
 |
RE: Sending E-Mails - 3/25/2007 11:02:14 PM
|
|
 |
|
| |
ginolard
Posts: 1044
Score: 21
Joined: 8/10/2005
Status: offline
|
It will take the lusername of the user running the script. So if run as an Adminstrator, it would end up being adminstrator@stockport.gov.uk However, there are some errors in your code. .From = wscript.echo objNet.username & "@stockport.gov.uk" should be .From = objNet.username & "@stockport.gov.uk" .TextBody = "Hostname: " & WshNetwork.ComputerName "This PC has Run Maintenance and created Errors. Please check the attached File." should be .TextBody = "Hostname: " & objNet.ComputerName & " This PC has Run Maintenance and created Errors. Please check the attached File."
_____________________________
Author of ManagePC - http://managepc.net AD Query Template - http://www.visualbasicscript.com/m_40609/tm.htm Consolidated Scripting Framework - http://www.visualbasicscript.com/m_59109/tm.htm
|
|
| |
|
|
|
 |
RE: Sending E-Mails - 3/26/2007 12:19:52 AM
|
|
 |
|
| |
ginolard
Posts: 1044
Score: 21
Joined: 8/10/2005
Status: offline
|
Vbscript doesn't do error logging very well. Basically, you need to put On Error Resume Next at the start of the script and, after every bit of code that MIGHT error out check the value of Err.Number So, for example ON Error Resume Next 'do some code that might error out If Err.Number > 0 Then msgbox "There was an error" End If
_____________________________
Author of ManagePC - http://managepc.net AD Query Template - http://www.visualbasicscript.com/m_40609/tm.htm Consolidated Scripting Framework - http://www.visualbasicscript.com/m_59109/tm.htm
|
|
| |
|
|
|
|
|