Solved

send email on schedulle

Posted on 2014-02-04
15
925 Views
Last Modified: 2014-02-04
Experts Exchange > Other > Lounge > Send Email On Schedule
Question
View SolutionAsk A New Question
send email on schedule
Asked by: ger2111
Solved by: captain
Hi,
I want to send notification emails on a fortnightly basis in a specific time window to a select number of users. I do not want to use outlook for this purpose , is there a way I can do this within exchange 2010 or can I use DB Mail in SQL 2005. Or is there some third party software that you can reccoment that will achieve same.

Thanks,
Ger
0
Comment
Question by:ger2111
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 9
  • 6
15 Comments
 
LVL 20

Expert Comment

by:n2fc
ID: 39831905
See the following article for a sample PowerShell script to send emails...

http://www.howtogeek.com/120011/stupid-geek-tricks-how-to-send-email-from-the-command-line-in-windows-without-extra-software/

Just create the appropriate script & use the task scheduler to run it every couple'a weeks...
0
 

Author Comment

by:ger2111
ID: 39832095
working with this, seeing

The remote certificate is invalid according to the validation procedure when I try to run the script,

think its to do with out exchange certificates, is there a way around this?
thanks,
Ger
0
 
LVL 20

Expert Comment

by:n2fc
ID: 39832104
You will need to manually add the certificate as valid to the machine running the script as it is probably self-signed and not from a recognized certification authority.
0
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 

Author Comment

by:ger2111
ID: 39832107
running the script on the exchange server -

How do I validate certificates - -

TYTYTY
0
 
LVL 20

Expert Comment

by:n2fc
ID: 39832117
When  you get the certificate error, check to see the cause...
It will either be due to expired (so renew it) or due to unrecognized certification authority (so you must manually add to trusted cert db)
0
 

Author Comment

by:ger2111
ID: 39832126
thanks for this -
the error in full:
Exception calling "Send" with "4" argument(s): "The remote certificate is invalid according to the validation procedur
."
At line:1 char:17
+ $SMTPClient.Send <<<< ($EmailFrom, $EmailTo, $Subject, $Body)
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : DotNetMethodException
0
 
LVL 20

Expert Comment

by:n2fc
ID: 39832142
Again, probably due to a self-signed certificate on the server...  (but check this)...

See:
http://blogs.msdn.com/b/jpsanders/archive/2009/09/16/troubleshooting-asp-net-the-remote-certificate-is-invalid-according-to-the-validation-procedure.aspx

for a procedure (step 1) to verify & correct this error...
0
 

Author Comment

by:ger2111
ID: 39832144
the first line of step one has me -
One super handy and technical tool to help you do this first step is Internet Explorer.  Simply try to hit the same URL that your ASP.NET web application tries to hit when it gets this error.  For example, type in to the browser the path to the .asmx file and see what Internet Explorer says about the certificate.

dont see any url in the error, using ie and browsing to https://exchangeserver returns the standard IIS splash screen.

stuck at this point..
0
 
LVL 20

Accepted Solution

by:
n2fc earned 500 total points
ID: 39832161
If you are using a local server (i.e. "exchangeserver") and it is setup to accept SMTP on port 25 as well, try NOT using SSL and port 25 to avoid the need for certificates altogether...

I think by following the example too literally (the gmail example shows using SSL only because gmail requires it) it is overly complicated for you...

See if you can get around this by using standard port 25 WITHOUT SSL!
0
 

Author Comment

by:ger2111
ID: 39832176
here is my script: have changed to port 25 but do not see where i can change to not use SSL:

Thanks again,

$EmailFrom = "payroll@domain.com"
$EmailTo = "user@domain.com"
$Subject = "PAYROLL AUTHORISATION"
$Body = "This is an auto reminder to please ensure Payroll File is AUTHORISED today.”
$SMTPServer = "exchangeserver"
$SMTPClient = New-Object Net.Mail.SmtpClient($SmtpServer, 25)
$SMTPClient.EnableSsl = $true
$SMTPClient.Credentials = New-Object System.Net.NetworkCredential(“domain\payroll”, “**********”);
$SMTPClient.Send($EmailFrom, $EmailTo, $Subject, $Body)
0
 

Author Comment

by:ger2111
ID: 39832177
ah, i see it now! my apologies
0
 

Author Comment

by:ger2111
ID: 39832181
wonderful, i have it working now, last couple of questions,

if i want to add multiple reciepients just seperate with a semi colon right?

and another quich one, how do i save the script, i mean, copy into notepad, what is the extension i need to add?


Thanks so much.
0
 
LVL 20

Expert Comment

by:n2fc
ID: 39832206
1) recipients separated by comma (not semicolon)

2) I believe the extension for powershell scripts is ".ps1"
0
 

Author Comment

by:ger2111
ID: 39832238
still not getting the emails out to multiple users, can you provide correct syntak for two users and I will follow your lead :

I have "user@domain.com","user2@domain.com" etc but it doesnt like that, some searching would suggest that I may need to dd a $recipients somethere in the script?


Nearly there
Thanks again,
0
 

Author Closing Comment

by:ger2111
ID: 39832297
cracked it, many thanks for your timely assistance throughout. Much appreciated,
Ger
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Lotus Notes – formerly IBM Notes – is an email client application, while IBM Domino (earlier Lotus Domino) is an email server. The client possesses a set of features that are even more advanced as compared to that of Outlook. Likewise, IBM Domino is…
How to resolve IMCEAEX NDRs in Exchange or Exchange Online related to invalid X500 addresses.
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question