...

View Full Version : Launch Email Client & Send Email



Acid
09-26-2005, 04:34 PM
I'm using the JavaScript Shell.Execute command to run applications from my organisations intranet when a link is clicked on. Our default email client is Novell GroupWise. The idea is I would like to create something that has the same kind of effect as a mailto: hyperlink. So rather than GroupWise simply opening, it opens and brings up a send email window with the email address entered for you like how Outlook does when you click a mailto: link as naturally you cannot set your email client to GroupWise in IE. The code I have so far is:


<script type="text/javascript">

var idShell = new ActiveXObject("Shell.Application");

function LaunchGroupWise() {
idShell.ShellExecute("GrpWise.exe");

}

</script>

<a href="javascript:void(0)" onClick="LaunchGroupWise();" title="Launch Novell GroupWise">GroupWise</a>What I was hoping is possible is that there is some type of send email parameter that could be added to automatically populate the To field of the email such as:


<script type="text/javascript">

var idShell = new ActiveXObject("Shell.Application");

function LaunchGroupWise() {
idShell.ShellExecute("GrpWise.exe", "", "mailto:some@one.com");

}

</script>

<a href="javascript:void(0)" onClick="LaunchGroupWise();" title="Launch Novell GroupWise">GroupWise</a>Naturally the above doesn't work, but does anyone know of something which might make this possible?

nikkiH
09-26-2005, 08:49 PM
For my intranet apps that use this sort of thing, I check the documentation for command-line (DOS) params I could use, then shell.execute that whole DOS command.

rm-f
09-26-2005, 08:58 PM
I assume your Intranet is M$ based /new ActiveXObject(..)/

Instead of running a shell ActiveX you should use the ActiveX SMTP client. Search Internet for one (or you can write one).

the javascript code should look like as:


<script>
function sendMsg() {
var smtpClient = new ActiveXObject('mySmtpComponent');
smtpClient.Server('smtp.company.com');
smtpClient.To('aaa@company.com');
smtpClient.Sender('myself@company.com');
smtpClient.Subject('sunject Line');
smtpClient.Text('blah blah blah');
smtpClient.Send();
}
</script>

Bad thing is every PC needs to have SMTP Client installed (dinamically download).

The better solution is to send mail from application server insetad of browser, unless email is to be sent as warning when application server is down.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum