Micro Niche Builder
Closed Thread
Results 1 to 4 of 4

Thread: Need Help for sending Mail

  1. #1

    Default Need Help for sending Mail

    Is there any technique using which we can send Email to anyone in Javascript...? If there is, pls. tell me...!! Thanx in Advance...


  2. SEO Software

  3. #2

    Default

    I dont think there is anyway to send mail using javascript as it it client side scripting.
    You need to use client side scripting.

  4. #3

    Default

    Quote Originally Posted by Avss View Post
    Is there any technique using which we can send Email to anyone in Javascript...? If there is, pls. tell me...!! Thanx in Advance...
    this is the code that you require to send mail

    <script language="JavaScript" src="sendemail.js"></script>

    line in your web page.

    //First create the Mail() object and set in on a variable
    var easymail=new Mail();

    //Set the server type, so the script can know which page to call, the asp or php, if you are using a PHP server
    //replace the "ASP_SERVER" wit // h "PHP_SERVER", by default the // server is set to PHP_SERVER

    //NOTE: If you choose ASP_SERVER you must have CDONTS component installed
    //in your server in order to send the em // ails
    easymail.ServerType=ASP_SERVER;

    //Now set the address to which the email will be sended
    easymail.To="username@email.com";
    //Add the CC address
    easymail.Cc="username2@email.com";
    //Add the BCC address
    easymail.Bcc="username3@email.com";

    //Now set the address of the one that sends the email
    easymail.ReplyTo="me@email.com";

    //Now set the subject of the email
    easymail.Subject="Here goes the subject of the email";

    //Set the message of the email
    easymail.Message="Here is the content of the email message, if you want to split text into lines so it can be readable, you can use the '\r\n' characters, or better";

    //Send the email
    easymail.Send();

    Now, if you want to know if the ASP/PHP was already loaded and/or if you want to know if the email was sended correctly, you can use some special variables which are:
    1. EmailSenderAccessed - If it is set to true then the ASP/PHP email page was loaded
    2. EmailSended - If it is set to true then the email was sended correctly

    I have included some code so you can know if the email page was loaded and if the email was sended correctly, add the following code to the previous one.

    function CheckEmail(){
    //Show the message in the status bar
    // window.status="Sending email...";
    //Check if the ASP/PHP email page was al // ready loaded
    if(EmailSenderAccessed){
    //Now check if the email was sended or n // ot and show the message
    if(EmailSended) window.alert("The email was sended succesully!");
    else window.alert("The email could not be sended");
    }
    //If ASP/PHP email page is not loaded ye // t, then check it again in 0.5 seconds (500 milliseconds)
    else{
    setTimeout("CheckEmail();", 500);
    }

    }

    //Send the email
    easymail.Send();
    //Now call the function what will alert // user when email was sended
    CheckEmail();

  5. #4

    Default

    In your script it shows the following:
    Quote Originally Posted by harry View Post
    //Set the server type, so the script can know which page to call, the asp or php, if you are using a PHP server
    //replace the "ASP_SERVER" wit // h "PHP_SERVER", by default the // server is set to PHP_SERVER
    So you will need a server with ASP or PHP

Closed Thread

Similar Threads

  1. Sending money as gift in paypal
    By valendino in forum Payment Processors
    Replies: 2
    Last Post: 01-27-2010, 01:26 AM
  2. Need hosting for sending emails
    By valendino in forum Web Hosting Offers
    Replies: 1
    Last Post: 12-21-2009, 02:47 PM
  3. sending email using JS
    By Jenniferlinn in forum JavaScript Help
    Replies: 8
    Last Post: 07-31-2009, 06:54 PM
  4. Are all directories sending mails upon submissions?
    By learn2earn in forum Web Directories
    Replies: 6
    Last Post: 05-11-2009, 04:34 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts