| Main Menu |
Subscribe To Be Contacted
<% ' Check to see if the "EmailTo" field as filled out, if it was, assume ' all other fields were filled out and try to send email If Len(Request("EmailTo")) > 0 Then ' Instantiate the COM Object Set Msg = Server.CreateOBject( "JMail.Message" ) ' Set logging to true to ease any potential debugging ' And set silent to true as we wish to handle our errors ourself Msg.Logging = True Msg.Silent = True ' Most mailservers require a valid email address ' for the sender Msg.From = Request("EmailFrom") Msg.FromName = Request("EmailFromName") ' Next we have to add some recipients. ' The addRecipients method can be used multiple times. ' We skip the name the second time, it 'It is ptional to provide a name. Msg.AddRecipient Request("EmailTo"), Request("EmailToName") ' The subject of the message Msg.Subject = Request("Subject") ' The body property is both read and write. ' If you want to append text to the body you can ' use JMail.Body = JMail.Body & "Hello world! " ' or you can use JMail.AppendText "Hello World! " ' which in many cases is easier to use. Msg.Body = Request("Body") ' To send the message, you use the Send() ' method, which takes one parameter that ' should be your mailservers address ' ' To capture any errors which might occur, ' we wrap the call in an IF statement If Not Msg.Send("192.168.1.35:2525" ) then (this will change depending on which server your account resides on, click here to find out what IP address is assigned to your server. Response.write " " & Msg.Log & "" else Response.write "Message sent succesfully!" End If ' And we're done! the message has been sent. Else%> <%End If%> if you have any questions, comments or have found any problems concerning this web site please email the web master
| Counties
|
| |