timur38 Posted May 29, 2013 Share Posted May 29, 2013 Hi, could you help me please. I trying using script and getting errors. $SmtpServer = "smtp.office365.com" ; address for the smtp-server to use - REQUIRED $FromName = "Me" ; name from who the email was sent $FromAddress = "email5@*****.com" ; address from where the mail should come $ToAddress = "timur38@gmail.com" ; destination address of the email - REQUIRED $Subject = "Mail Test" ; subject from the email - can be anything you want it to be $Body = "" ; the messagebody from the mail - can be left blank but then you get a blank mail $AttachFiles = "" ; the file(s) you want to attach seperated with a ; (Semicolon) - leave blank if not needed $CcAddress = "" ; address for cc - leave blank if not needed $BccAddress = "" ; address for bcc - leave blank if not needed $Importance = "Normal" ; Send message priority: "High", "Normal", "Low" $Username = "email5@*****.com" ; username for the account used from where the mail gets sent - REQUIRED $Password = "password" ; password for the account used from where the mail gets sent - REQUIRED $IPPort = 587 ; port used for sending the mail $ssl = 0 ; enables/disables secure socket layer sending - put to 1 if using httpS ;~ $IPPort=465 ; GMAIL port used for sending the mail ;~ $ssl=1 ; GMAILenables/disables secure socket layer sending - put to 1 if using httpS "error code 2 description the transport failed to connect to the server" I also tried to use gmail account. $SmtpServer = "smtp.gmail.com" ; address for the smtp-server to use - REQUIRED $FromName = "Me" ; name from who the email was sent $FromAddress = "timur38@gmail.com" ; address from where the mail should come $ToAddress = "timur@gmail.com" ; destination address of the email - REQUIRED $Subject = "Mail Test" ; subject from the email - can be anything you want it to be $Body = "" ; the messagebody from the mail - can be left blank but then you get a blank mail $AttachFiles = "" ; the file(s) you want to attach seperated with a ; (Semicolon) - leave blank if not needed $CcAddress = "" ; address for cc - leave blank if not needed $BccAddress = "" ; address for bcc - leave blank if not needed $Importance = "Normal" ; Send message priority: "High", "Normal", "Low" $Username = "timur38@gmail.com" ; username for the account used from where the mail gets sent - REQUIRED $Password = "Password" ; password for the account used from where the mail gets sent - REQUIRED $IPPort = 465 ; port used for sending the mail $ssl = 1 ; enables/disables secure socket layer sending - put to 1 if using httpS ;~ $IPPort=465 ; GMAIL port used for sending the mail ;~ $ssl=1 ; GMAILenables/disables secure socket layer sending - put to 1 if using httpS And got The message could not be sent to the SMTP server. The transport error code was 0x80040217. The server response was not available" Thank you Link to comment Share on other sites More sharing options...
Artisan Posted May 29, 2013 Share Posted May 29, 2013 I guarantee you that the scripts you have posted will not cause any errors whatsoever. Really. They're just variable declarations. The issue is most likely with what you're doing after you've declared your variables. We'll need a more information if you want any actual help. Link to comment Share on other sites More sharing options...
water Posted May 29, 2013 Share Posted May 29, 2013 Looks like he is calling _INetSMTPMailCOM written by Jos. Most of the problems I have seen being discussed on this forum are related to wrong parameters or the target mail system not supporting the specified features (SSL etc.). Search the forum for the error messages and I'm sure you'll get some hits. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now