using vbscipt or java script to send emails (help)

Hi I have been looking for away of making a html webpage send email using client script, I found some code but it doesn't work , I don't want to use server side scripts , this is what I got <HTML> <TITLE>Sending mail</TITLE> <bODY> <script language="VBScript"> sub submit_onclick() Set objEmail = CreateObject("CDO.Message") objEmail.From = "myemail@mydomain.com" objEmail.To = "recipient@recepientdomain.com" objEmail.Subject = "Secuity Report for " & strServerName objEmail.Textbody = "Server Secutirity Report for" & strServerName & vbCRL & strBodyReport objEmail.AddAttachment = strFilename objEmail.Configuration.Fields.Item _("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 objEmail.Configuration.Fields.Item _("http://schemas.microsoft.com/cdo/configuration/smtpserver") = _"smtp ip" objEmail.Configuration.Fields.Item _("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 objEmail.Configuration.Fields.Update objEmail.Send end sub </script> <form name="getter"> <P> Subject <INPUT TYPE=TEXTFILED NAME="Subject"> </p> <P> body<INPUT TYPE=TEXTFILED NAME= "body"> </P> <INPUT TYPE= "button" value="send_mail" name="submit"> </hTML> Is this possible or what am I doing wrong? Rgds GG

On Wed, May 20, 2009 at 10:43 AM, Geoffrey Gitagia <ggitagia@virtualcity.co.ke> wrote:
I have been looking for away of making a html webpage send email using client script, I found some code but it doesn’t work , I don’t want to use server side scripts , this is what I got
Various reasons it may not be working : -- You are using VBScript - which will run only on Internet Explorer and not on Firefox... (Which browser are you using ?) -- Security restrictions in the browser - doing stuff like sending emails as client javascript / vbscript is generally a bad idea ... browsers will generally not run such code unless you lower the security profile for the browser... Ashok

In addition to the browser issues (I suggest you implement the code in JScript) You should also authenticate yourself to the smtp server. Make sure these settings are set set objConf = CreateObject("CDO.Configuration") Set objFlds = objConf.Fields With objFlds .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = " mail.yourhost.com" .Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = cdoBasic .Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "your-username" .Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "your-password" .Update End With The message object has a configuration property to which you can set this message On Wed, May 20, 2009 at 11:53 AM, <ashok+skunkworks@parliaments.info<ashok%2Bskunkworks@parliaments.info>
wrote:
On Wed, May 20, 2009 at 10:43 AM, Geoffrey Gitagia <ggitagia@virtualcity.co.ke> wrote:
I have been looking for away of making a html webpage send email
using
client script, I found some code but it doesn’t work , I don’t want to use server side scripts , this is what I got
Various reasons it may not be working :
-- You are using VBScript - which will run only on Internet Explorer and not on Firefox... (Which browser are you using ?) -- Security restrictions in the browser - doing stuff like sending emails as client javascript / vbscript is generally a bad idea ... browsers will generally not run such code unless you lower the security profile for the browser...
Ashok _______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks Other services @ http://my.co.ke Other lists ------------- Skunkworks announce: http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks-announce Science - http://lists.my.co.ke/cgi-bin/mailman/listinfo/science kazi - http://lists.my.co.ke/cgi-bin/mailman/admin/kazi/general
participants (3)
-
ashok+skunkworks@parliaments.info
-
Geoffrey Gitagia
-
Rad!