comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » sending email via idl?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: sending email via idl? [message #82738 is a reply to message #60767] Fri, 11 January 2013 06:18 Go to previous messageGo to previous message
Helder Marchetto is currently offline  Helder Marchetto
Messages: 520
Registered: November 2011
Senior Member
On Friday, January 11, 2013 2:26:30 PM UTC+1, alx wrote:
> Le mercredi 4 juin 2008 19:41:49 UTC+2, sudha a écrit :
>
>> Has anyone had any experience in writing an idl program to send email?
>
>> My software needs to have the ability to email an image attachment,
>
>> either when the user clicks a button, or as a notification at the end
>
>> of some computation.
>
>>
>
>> Thanks!
>
>>
>
>> Sudha
>
>
>
> I never did it.
>
> I guess that the "modern" Windows solution would be to spawn a powershell script using the built-in SmtpClient.Send function.
>
> alain.

Thanks Alain,
I'm not that modern and didn't know what the powershell was.
I googled a bit and found this: http://serverfault.com/questions/110057/easiest-way-to-send- an-email-from-the-command-line-using-windows-2003-r2
where a one line spawn command is given:

To make a one liner, save the following to a powershell script file (sendmail.ps1):

param(
[string] $From = "from@example.com",
[string] $To = "to@example.com",
[string] $Title = "title",
[string] $Body = "body"
)
$SmtpClient = New-Object System.Net.Mail.SmtpClient
$SmtpServer = "your.mail.host.com"
$SmtpClient.host = $SmtpServer
$SmtpClient.Send($From,$To,$Title,$Body)

and then call the powershell:
powershell.exe c:\path\to\sendmail.ps1 "from@example.com" "to@example.com" "title" "body"

Just have to sort out the credentials (user and pwd)...

Cheers,
Helder
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: sending email via idl?
Next Topic: Error Handling Advice

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 08:03:23 PDT 2025

Total time taken to generate the page: 0.00622 seconds