Simple CDO Mail script??

Hi,
I need to automatically send an e-mail as a asp-page loads.
No forms or interactivity, just a e-mail with a simple message.
Does anybody has such a script? I am using asp and
VisualBasic.
Thanks!!

Presuming CDONTS, it doesn't get much easier than the method
outlined here:
http://www.aspfaqs.com/aspfaqs/ShowFAQ.asp?FAQID=25
Simply plop it at the top of the page and away it goes :-)
Best regards,
Chris

Similar Messages

  • Simple fix for Included Mail Script

    This may have been mentioned elsewhere, but for those that have tried to use the "Display All Accounts And Preferences" AppleScript that Apple includes with Mail 2.x & discovered it doesn't work, the fix is simple:
    Open the script in Script Editor & use its search & replace for the line that reads:
    set theRulesPlist to (homeDir & "Library:Mail:MessageSorting.plist") as alias
    Replacing it with:
    set theRulesPlist to (homeDir & "Library:Mail:MessageRules.plist") as alias
    Save the script & it will now work without error.
    This script generates a new email message with tons of info about your accounts, preferences, & even the permissions of the folders Mail uses. This email item can be very useful for copying details about your account into Discussions posts. It doesn't actually address or sent the email, & you should be careful about sending it to anyone since it could reveal details about your accounts you don't want others to see.
    The same goes for any post here, of course.

    looking at Apple's example scripts is often enlightening.
    Actually, this is the only use I make of AppleScript.
    BTW, you can open rather than execute any script available
    in the app's Script Menu by holding down the option key when
    you select it.
    Again, thanks for the tip. I wasn't aware of that either.

  • FM with code to send a simple text mail to external ID

    Hi All,
    I need a FM with code if possible to send a simple text mail to an external e-mail id or distribution list. I tried using the FM SO_NEW_DOCUMENT_ATT_SEND_API1 and was successfull in sending mail. But it requires attachment.
    I need help to send mail without attachment with code.
    All configurations done at my end.
    Thanks
    Anirban Bhattacharjee

    Hi Anirban,
    Please check this sample code.
    * Email ITAB structure
    DATA: BEGIN OF EMAIL_ITAB OCCURS 10.
            INCLUDE STRUCTURE SOLI.
    DATA: END OF EMAIL_ITAB.
    DATA: T_EMAIL LIKE SOOS1-RECEXTNAM.  "EMail distribution list
    CONSTANTS: C_EMAIL_DISTRIBUTION LIKE SOOS1-RECEXTNAM VALUE
               ‘[email protected],[email protected]’.
    * Initialization
    REFRESH EMAIL_ITAB.
    * Populate data
    EMAIL_ITAB-LINE = ‘Email body text 1’.
    APPEND EMAIL_ITAB.
    EMAIL_ITAB-LINE = ‘Email body text 2’.
    APPEND EMAIL_ITAB.
    T_EMAIL = C_EMAIL_DISTRIBUTION.
    * --- EMAIL FUNCTION ---------------------------------------------------
    * REQUIRMENTS:
    * 1) The user running the program needs a valid email address in their
    *    address portion of tx SU01 under external comms -> SMTP -> internet
    *    address.
    * 2) A job called SAP_EMAIL is running with the following parameters:
    *    Program: RSCONN01  Variant: INT   User: XXX
    *    This program moves mail from the outbox to the mail server using
    *    RFC destination: SAP_INTERNET_GATEWAY_SERVER
    * INTERFACE:
    * 1) APPLICATION: Anything
    * 2) EMAILTITLE:  EMail subject
    * 3) RECEXTNAM:   EMail distribution lists separated by commas
    * 4) TEXTTAB:     Internal table for lines of the email message
    * EXCEPTIONS:
    * Send OK = 0 otherwise there was a problem with the send.
        CALL FUNCTION 'Z_SEND_EMAIL_ITAB'
             EXPORTING
                  APPLICATION = 'EMAIL'
                  EMAILTITLE  = 'Email Subject'
                  RECEXTNAM   = T_EMAIL
             TABLES
                  TEXTTAB     = EMAIL_ITAB
             EXCEPTIONS
                  OTHERS      = 1.
    Function Z_SEND_EMAIL_ITAB
    *"*"Local interface:
    *"       IMPORTING
    *"             VALUE(APPLICATION) LIKE  SOOD1-OBJNAM
    *"             VALUE(EMAILTITLE) LIKE  SOOD1-OBJDES
    *"             VALUE(RECEXTNAM) LIKE  SOOS1-RECEXTNAM
    *"       TABLES
    *"              TEXTTAB STRUCTURE  SOLI
    *- local data declaration
      DATA: OHD    LIKE SOOD1,
            OID    LIKE SOODK,
            TO_ALL LIKE SONV-FLAG,
            OKEY   LIKE SWOTOBJID-OBJKEY.
      DATA: BEGIN OF RECEIVERS OCCURS 0.
              INCLUDE STRUCTURE SOOS1.
      DATA: END OF RECEIVERS.
    *- fill odh
      CLEAR OHD.
      OHD-OBJLA    = SY-LANGU.
      OHD-OBJNAM   = APPLICATION.
      OHD-OBJDES   = EMAILTITLE.
      OHD-OBJPRI   = 3.
      OHD-OBJSNS   = 'F'.
      OHD-OWNNAM   = SY-UNAME.
    *- send Email
      CONDENSE RECEXTNAM NO-GAPS.
      CHECK RECEXTNAM <> SPACE AND RECEXTNAM CS '@'.
    *- for every individual recipient send an Email
    * (see OSS message 0120050409/0000362105/1999)
      WHILE RECEXTNAM CS ','.
        PERFORM INIT_REC TABLES RECEIVERS.
        READ TABLE RECEIVERS INDEX 1.
        RECEIVERS-RECEXTNAM = RECEXTNAM+0(SY-FDPOS).
        ADD 1 TO SY-FDPOS.
        SHIFT RECEXTNAM LEFT BY SY-FDPOS PLACES.
        MODIFY RECEIVERS INDEX 1.
        PERFORM SO_OBJECT_SEND_REC
         TABLES TEXTTAB RECEIVERS
          USING OHD.
      ENDWHILE.
    *- check last recipient in recipient list
      IF RECEXTNAM <> SPACE.
        PERFORM INIT_REC TABLES RECEIVERS.
        READ TABLE RECEIVERS INDEX 1.
        RECEIVERS-RECEXTNAM = RECEXTNAM.
        MODIFY RECEIVERS INDEX 1.
        PERFORM SO_OBJECT_SEND_REC
         TABLES TEXTTAB RECEIVERS
          USING OHD.
      ENDIF.
    ENDFUNCTION.
    *       FORM SO_OBJECT_SEND_REC                                       *
    FORM  SO_OBJECT_SEND_REC
    TABLES  OBJCONT      STRUCTURE SOLI
            RECEIVERS    STRUCTURE SOOS1
    USING   OBJECT_HD    STRUCTURE SOOD1.
      DATA:   OID     LIKE SOODK,
              TO_ALL  LIKE SONV-FLAG,
              OKEY    LIKE SWOTOBJID-OBJKEY.
      CALL FUNCTION 'SO_OBJECT_SEND'
           EXPORTING
                EXTERN_ADDRESS             = 'X'
                OBJECT_HD_CHANGE           = OBJECT_HD
                OBJECT_TYPE                = 'RAW'
                OUTBOX_FLAG                = 'X'
                SENDER                     = SY-UNAME
           IMPORTING
                OBJECT_ID_NEW              = OID
                SENT_TO_ALL                = TO_ALL
                OFFICE_OBJECT_KEY          = OKEY
           TABLES
                OBJCONT                    = OBJCONT
                RECEIVERS                  = RECEIVERS
           EXCEPTIONS
                ACTIVE_USER_NOT_EXIST      = 1
                COMMUNICATION_FAILURE      = 2
                COMPONENT_NOT_AVAILABLE    = 3
                FOLDER_NOT_EXIST           = 4
                FOLDER_NO_AUTHORIZATION    = 5
                FORWARDER_NOT_EXIST        = 6
                NOTE_NOT_EXIST             = 7
                OBJECT_NOT_EXIST           = 8
                OBJECT_NOT_SENT            = 9
                OBJECT_NO_AUTHORIZATION    = 10
                OBJECT_TYPE_NOT_EXIST      = 11
                OPERATION_NO_AUTHORIZATION = 12
                OWNER_NOT_EXIST            = 13
                PARAMETER_ERROR            = 14
                SUBSTITUTE_NOT_ACTIVE      = 15
                SUBSTITUTE_NOT_DEFINED     = 16
                SYSTEM_FAILURE             = 17
                TOO_MUCH_RECEIVERS         = 18
                USER_NOT_EXIST             = 19
                X_ERROR                    = 20
                OTHERS                     = 21.
      IF SY-SUBRC <> 0.
        RAISE OTHERS.
      ENDIF.
    ENDFORM.
    *       FORM INIT_REC                                                 *
    FORM INIT_REC TABLES RECEIVERS STRUCTURE SOOS1.
      CLEAR RECEIVERS.
      REFRESH RECEIVERS.
      MOVE SY-DATUM  TO RECEIVERS-RCDAT .
      MOVE SY-UZEIT  TO RECEIVERS-RCTIM.
      MOVE '1'       TO RECEIVERS-SNDPRI.
      MOVE 'X'       TO RECEIVERS-SNDEX.
      MOVE 'U-'      TO RECEIVERS-RECNAM.
      MOVE 'U'       TO RECEIVERS-RECESC.
      MOVE 'INT'     TO RECEIVERS-SNDART.
      MOVE '5'       TO RECEIVERS-SORTCLASS.
      APPEND RECEIVERS.
    ENDFORM.
    Hope this will help.
    Regards,
    Ferry Lianto

  • PHP Form Mail Scripts

    What is a good resource for pre-made PHP Form Mailer Scripts.
    This is for use with a website hosted on GoDaddy.
    My client has a few requirements that the GoDaddy script does
    not offer (and the script I chose from GoDaddy is uneditable). I
    know nothing about scripting but thought I could use a pre-made
    script and modify it...is that crazy thinking on my part?
    Here are the special requests from my client:
    - They'd like to see the time the form was submitted in EST
    (the GoDaddy script puts the time in military time in another time
    zone in the subject line). Can this appear in the body of the email
    as well as the subject line?
    - They'd like the form to be sent to the person submitting it
    as well as to their company
    - They would like to be able to REPLY TO the email they
    receive with the form submission and have it be addressed to the
    person submitting the form. The current script has the email
    addressed to themselves (the company) if they click REPLY TO, so
    they are replying to themselves
    - Although this has nothing to do with the Form Mailer script
    as far as I can guess, they asked that the person filling out the
    form be able to print it prior to submitting (in my opinion,
    though, if i can have a copy of the submission sent to the
    submitter, there's no reason for this). But if anyone knows how to
    do this, please let me know.
    - Finally, the client wants to know if each submission can
    have a unique tracking number assigned to it.
    Thank you all. Any feedback is appreciated.
    Richard

    Hi,
    I can without any doubt recommend Forms 2 Go:
    http://www.bebosoft.com/products/formstogo/index.php
    Very easy to use and even someone like me who don't know a
    lot of
    programming, use it extensively.
    Deon
    "RichyZee" <[email protected]> wrote in
    news:gcvkac$fcp$[email protected]:
    > What is a good resource for pre-made PHP Form Mailer
    Scripts. This is
    > for use with a website hosted on GoDaddy.
    >
    > My client has a few requirements that the GoDaddy script
    does not
    > offer (and
    > the script I chose from GoDaddy is uneditable). I know
    nothing about
    > scripting but thought I could use a pre-made script and
    modify it...is
    > that crazy thinking on my part?
    >
    > Here are the special requests from my client:
    >
    > - They'd like to see the time the form was submitted in
    EST (the
    > GoDaddy
    > script puts the time in military time in another time
    zone in the
    > subject line). Can this appear in the body of the email
    as well as the
    > subject line?
    >
    > - They'd like the form to be sent to the person
    submitting it as well
    > as to
    > their company
    >
    > - They would like to be able to REPLY TO the email they
    receive with
    > the form
    > submission and have it be addressed to the person
    submitting the form.
    > The current script has the email addressed to themselves
    (the company)
    > if they click REPLY TO, so they are replying to
    themselves
    >
    > - Although this has nothing to do with the Form Mailer
    script as far
    > as I can
    > guess, they asked that the person filling out the form
    be able to
    > print it prior to submitting (in my opinion, though, if
    i can have a
    > copy of the submission sent to the submitter, there's no
    reason for
    > this). But if anyone knows how to do this, please let me
    know.
    >
    > - Finally, the client wants to know if each submission
    can have a
    > unique
    > tracking number assigned to it.
    >
    > Thank you all. Any feedback is appreciated.
    >
    > Richard
    >
    >

  • This.getField error in app.Mail script

    I am having trouble with an app.Mail script I have created in a Lifecycle form.  If I place a this.getField("field_name") line in the script Acrobat Javascript debugger states that the this.getField is not a function.  Also the this.path line returns as undefined in the email message body if bypass the this.getField line.  Perhaps I am mixing up Javascript script and Lifecycle scripting?  If so what needs to be changed for Lifecycle?  I know the app.mail script works without the var lines, but once I add those in is when the problems pop up.  Script listed below.  Thanks!
    var cMyMsg = this.path
    var Sub = this.getField("Field_Name").value;
    app.mailMsg({bUI: true, cTo: "[email protected], cSubject: Sub, cMsg: cMyMsg});

    Hi,
    Your script is written using Acrobat JavaScript, whereas because you are working in LiveCycle Designer you need to make the script compatible with the LiveCycle Designer form JavaScript.
    The code could be changed to this which works in LiveCycle Designer
    var cMyMsg = event.target.path
    // Assuming the Field_Name field is in the same subform as the button to run the code
    var Sub = Field_Name.rawValue;
    app.mailMsg({bUI: true, cTo: "[email protected]", cSubject: Sub, cMsg: cMyMsg});
    Hope this helps
    Malcolm

  • Simple CGI mail kicking my butt!

    I am attempting to impliment a simple CGI mail page on my server.
    The code comes from: http://www.boutell.com/email/
    I have followed the directions to the letter. When I call up my html form and submit I get this error:
    "Email Rejected: The requested destination address is not one of the permitted email recipients. Please read the documentation before installing email.cgi."
    this apears to show that the email address in my email.conf does not match the recipient address in my html file. I have gone over and even copied it between files.
    As far as I can tell I have this configured correctly. The email.cgi is in the /CGI-Executables/ and it's permissions are 777. My email.conf file is in the proper directory and if I move it or change the name I get an error that it is not found.
    This is so simple I cannot find what I have missed.
    Help please
    Xserver G5   Mac OS X (10.4.7)  

    Well, you're right about it being simple :-P
    I just downloaded and tested it out. In my case, I changed the email.conf file to /Library/WebServer/email.conf. It's owned by me with group admin permissions rw-r--r--. In it, I have:<pre>[email protected]
    /</pre>I used my actual email address though. The second line just tells it to return to the site's home page when it's done.
    The email.cgi file is in /Library/WebServer/CGI-Executables/email.cgi with owner me group admin, permissions rwxrwxrwx.
    Then I have an email.html file in /Library/WebServer/Documents, following the template on their web page. The only thing I changed from the template on their web page is the hidden form field "recipient" -- changed it from "changeme" to "[email protected]" (again, substituted with me real email address).
    It worked on the first shot. Do you have a target redirect line after the email address in your email.conf file? Did you remember to change the form field in your HTML form to match a legal email address?

  • Yahoo mail script -safari unresponsive

    We are regularly getting a message saying that a Yahoo mail script is making Safari (3.1.2 for Mac) unresponsive. We are running Leopard 10.5.5. Any solutions??? Thanks.

    In addition to being unresponsive, it seems to slow down the Macbook as a whole, but we can't find a remedy. Any ideas would be appreciated.

  • E-mail script size is miniscule and cannot get it back to normal size

    While scrolling on the e-mail site the script suddenly decreased in size to the point it is not legible. It seems the page size somehow shrunk and the script size decreased. Have tried to bring use cursor to bring screen size back down to bottom of monitor without any success. When using Internet Explorer e-mail script is normal.

    Make sure that you do not run Firefox in full screen mode (press F11 or Fn + F11 to toggle; Mac: command+Shift+F).<br />
    If you are in full screen mode then hover the mouse to the top to make the Navigation Toolbar and Tab bar appear.<br />
    You can click the Maximize button at the top right to leave full screen mode or right click empty space on a toolbar and use "Exit Full Screen Mode" or press F11.<br />

  • Simple mail script

    Hei
    I am trying to make a simple script that does the following.
    Activate mail (that i can)
    Show message window,-. inbox (that i can not figure out)
    check for new mail (that i can do)
    Its all in one script, but the second one i can not figure out.
    Here's what i came up with so far.
    tell application "Mail"
    activate
    end tell
    tell application "Mail"
    open "indbox"
    end tell
    tell application "Mail" to check for new mail
    The "end tells" after every command is not necessary i know....
    To sum it up, whats the script to open message window in mail.app

    tell application "Mail"
    activate -- Make 'Mail' front most process.
    try
    my handleMessageViewer()
    on error -- Handle exception ...
    make new message viewer -- Create a new 'message viewer' window.
    my handleMessageViewer()
    end try
    check for new mail -- Check for new e-Mail messages.
    end tell
    on handleMessageViewer()
    tell application "Mail" to set selected mailboxes of message viewer 1 to {inbox} -- Select 'Inbox'.
    end handleMessageViewer
    ... or ...
    tell application "Mail"
    activate -- Make 'Mail' front most process.
    try
    set selected mailboxes of message viewer 1 to {inbox} -- Select 'Inbox'.
    on error -- Handle exception ...
    make new message viewer -- Create a new 'message viewer' window.
    set selected mailboxes of message viewer 1 to {inbox} -- Select 'Inbox'.
    end try
    check for new mail -- Check for new e-Mail messages.
    end tell
      Mac OS X (10.4.6)  

  • Simple formatting question for mail-script

    I would like to edit the script below, so that theSubject ends up on a line of it's own,
    and messageURL indented on a new line below. It's important that it's indented.
    As it is now, the sixth line from the bottom counted; "make new entry with properties
    {name:theSubject & messageURL}" puts everything on the same line.
    tell application "Mail"
    try
    set theSelection to the selection
    repeat with theMessage in theSelection
    my importMessage(theMessage)
    end repeat
    end try
    end tell
    on importMessage(theMessage)
    tell application "Mail"
    try
    set theSubject to subject of theMessage
    set messageURL to "message://%3C" & (message id of theMessage) & "%3E"
    tell application "TaskPaper"
    tell front document
    make new entry with properties {name:theSubject & messageURL}
    end tell
    end tell
    end try
    end tell
    end importMessage
    Thanks in advance,
    Hakan
    Message was edited by: swedishstargazer

    How do I create a new entry with messageURL indented?
    Here's an approximate example of what I get with TaskPaper when I run your script as modified in my previous post:
    Cyberlettre du 19-01-2011 - Pétition - Tunisie
         message://%3C20110120170231.7BEB23D619@pmta4-1-fe10%3E
    Haïti : un an après le séisme
         message://%3C5464456.3052551294847006313.JavaMail.root@server8565%3E
    Surely I don't understand what you mean by “indented", since I would have considered lines 2 and 4 above as “indented”.

  • Need help with PHP mail script [was: Can someone please help me?]

    I'm trying to collect data from a form and email it.  I'm using form2mail.php and the problem is that the email is not collecting the form info and it has the same email address in the From: and To: lines. I'm really stuck and would appreciate any help.
    Here is the HTML code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Contact Us</title>
    <style type="text/css">
    <!--
    .style1 {font-family: Verdana, Arial, Helvetica, sans-serif}
    .style2 {
    font-size: 14px;
    color: #000000;
    body {
    background-color: #FFFFFF;
    body,td,th {
    color: #CC3300;
    .style3 {font-size: 14px; font-weight: bold; }
    .style6 {font-size: 18px}
    .style7 {font-size: 16px}
    .style8 {font-size: 16px; font-family: Verdana, Arial, Helvetica, sans-serif; }
    .style9 {font-size: 16px; font-weight: bold; font-family: Verdana, Arial, Helvetica, sans-serif; }
    .style10 {color: #000000}
    -->
    </style>
    </head>
    <body>
    <div align="center"><img src="nav2.jpg" alt="nav bar" width="698" height="91" border="0" usemap="#Map2" />
      <map name="Map2" id="Map2">
      <area shape="rect" coords="560,9,684,38" href="accessories.html" />
    <area shape="rect" coords="456,8,548,38" href="contact.html" />
    <area shape="rect" coords="305,8,435,40" href="photog.html" />
    <area shape="rect" coords="187,9,283,39" href="services.html" />
    <area shape="rect" coords="81,10,167,39" href="aboutus.html" />
    <area shape="rect" coords="5,10,68,39" href="index.html" />
    </map>
      <map name="Map" id="Map">
        <area shape="rect" coords="9,9,69,39" href="index.html" />
        <area shape="rect" coords="83,11,165,39" href="aboutus.html" />
        <area shape="rect" coords="182,9,285,38" href="services.html" />
        <area shape="rect" coords="436,14,560,37" href="contact.html" />
        <area shape="rect" coords="563,14,682,38" href="accessories.html" />
      </map>
    </div>
    <p> </p>
    <form id="TheForm" name="TheForm" action="form2mail.php" method="post">
      <p align="center" class="style2">P<span class="style1">lease fill out form below for a &quot;free no obligation quote&quot; then click submit.</span></p>
      <p align="center" class="style3">(*Required Information)</p>
      <div align="center">
        <pre><strong><span class="style8">*Contact Name</span> </strong><input name="name" type="text" id="name" />
    <span class="style8"><strong>
    Business Name </strong></span><input name="bn" type="text" id="bn" />
    <span class="style8"><strong>*Phone Number <input type="text" name="first" size="3" onFocus="this.value='';"
        onKeyup="checkNumber(this.value); autoTab(this, document.TheForm.second);" maxlength="3" value="###" /> - <input type="text" name="second" size="3" onFocus="this.value='';" onKeyup="checkNumber(this.value); autoTab(this, document.TheForm.third);" maxlength="3" value="###" /> - <input type="text" name="third" size="4" onFocus="this.value='';" onKeyup="checkNumber(this.value); autoTab(this, document.TheForm.fourth);" maxlength="4" value="####"/> </strong></span>
    <strong><span class="style1">*</span><span class="style8">Email Address</span> <input name="email" type="text" id="email" />     </strong> </pre>
        <label><span class="style9">*Re-enter to confirm</span>
        <input name="emx" type="text" id="emx" /></label><br /><br /><span class="style9">
    <label></label>
        </span>
        <p><span class="style9">*Best time to call </span>
          <select name="name1[]" multiple size="1" >
            <option>8am-9am</option>
            <option>9am-10am</option>
            <option>10am-11am</option>
            <option>11am-12pm</option>
            <option>12pm-1pm</option>
            <option>1pm-2pm</option>
            <option>2pm-3pm</option>
            <option>3pm-4pm</option>
            <option>4pm-5pm</option>
            <option>5pm-6pm</option>
            <option>6pm-7pm</option>
            <option>7pm-8pm</option>
          </select>
          <br />
          <br />
          <span class="style9">Type of Location</span>
          <select name="name2[]" multiple size="1" >
            <option>Residential</option>
            <option>Commercial</option>
          </select>
          <br />
          <br />
            <span class="style1"><br />
            <strong><br />
              <span class="style6">*Type of Services Requested:</span></strong><br />
            </span><strong><span class="style10">(check all that apply)</span><br />
                </strong><br />
                <span class="style7"><span class="style1"><strong>Janitorial cleaning</strong></span>
                <input type="checkbox" name="checkbox[]" value="checkbox" multiple/>
                <br />
                </span><strong><br />
                  <span class="style8">Mobile Auto Detailing</span>
                <input type="checkbox" name="checkbox2[]" value="checkbox" multiple/>
                <br />
                <br />
                  </strong><span class="style9">Moving/Hauling</span>
          <input type="checkbox" name="checkbox3[]" value="checkbox" multiple/>
          <br />
          <br />
                  <span class="style9">Pressure washing</span>
          <input type="checkbox" name="checkbox4[]" value="checkbox" multiple/>
          <br />
          <br />
                  <span class="style9">Window washing</span>
          <input type="checkbox" name="checkbox5[]" value="checkbox" multiple/>
          <br />
          <br />
                  <span class="style9">Window Tinting</span>
          <input type="checkbox" name="checkbox6[]" value="checkbox" multiple/>
          <br />
          <br />
                  <span class="style9">Boat cleaning</span>
          <input type="checkbox" name="checkbox7[]" value="checkbox" multiple/>
          <br />
          <br />
                  <span class="style9">RV cleaning</span>
          <input type="checkbox" name="checkbox8[]" value="checkbox" multiple/>
          <br />
          <br />
                  <span class="style9">Motorcycle cleaning</span>
          <input type="checkbox" name="checkbox9[]" value="checkbox" multiple/>
          <br />
          <br />
          <br />
          <br />
          <input name="SB"  type="button" class="style9" value="Submit" onClick="sendOff();">
        </p>
      </div></label>
      <script language="JavaScript1.2">
    // (C) 2000 www.CodeLifter.com
    // http://www.codelifter.com
    // Free for all users, but leave in this  header
    var good;
    function checkEmailAddress(field) {
    // Note: The next expression must be all on one line...
    //       allow no spaces, linefeeds, or carriage returns!
    var goodEmail = field.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org) |(\..{2,2}))$)\b/gi);
    if (goodEmail){
       good = true
    } else {
       alert('Please enter a valid e-mail address.')
       field.focus()
       field.select()
       good = false
    function autoTab(startPoint,endPoint){
    if (startPoint.getAttribute&&startPoint.value.length==startPoint.getAttribute("max length"))
    endPoint.focus();
    function checkNumber(phoneNumber){
    var x=phoneNumber;
    var phoneNumber=/(^\d+$)|(^\d+\.\d+$)/
    if (phoneNumber.test(x))
    testResult=true
    else{
    alert("Please enter a valid number.")
    phoneNumber.focus();
    phoneNumber.value="";
    testResult=false
    return (testResult)
    function sendOff(){
       namecheck = document.TheForm.name.value   
       if (namecheck.length <1) {
          alert('Please enter your name.')
          return
       good = false
       checkEmailAddress(document.TheForm.email)
       if ((document.TheForm.email.value ==
            document.TheForm.emx.value)&&(good)){
          // This is where you put your action
          // if name and email addresses are good.
          // We show an alert box, here; but you can
          // use a window.location= 'http://address'
          // to call a subsequent html page,
          // or a Perl script, etc.
          window.location= 'form2mail.php';
       if ((document.TheForm.email.value !=
              document.TheForm.emx.value)&&(good)){
              alert('Both e-mail address entries must match.')
    </script>
    </form>
    <p> </p>
    </body>
    </html>
    and here is the form2mail.php:
    <?php
    # You can use this script to submit your forms or to receive orders by email.
    $MailToAddress = "[email protected]"; // your email address
    $redirectURL = "http://www.chucksmobile.com/thankyou.html"; // the URL of the thank you page.
    $MailSubject = "[Customer Contact Info]"; // the subject of the email
    $sendHTML = FALSE; //set to "false" to receive Plain TEXT e-mail
    $serverCheck = FALSE; // if, for some reason you can't send e-mails, set this to "false"
    # copyright 2006 Web4Future.com =================== READ THIS ===================================================
    # If you are asking for a name and an email address in your form, you can name the input fields "name" and "email".
    # If you do this, the message will apear to come from that email address and you can simply click the reply button to answer it.
    # To block an IP, simply add it to the blockip.txt text file.
    # CHMOD 777 the blockip.txt file (run "CHMOD 777 blockip.txt", without the double quotes)
    # This is needed because the script tries to block the IP that tried to hack it
    # If you have a multiple selection box or multiple checkboxes, you MUST name the multiple list box or checkbox as "name[]" instead of just "name"
    # you must also add "multiple" at the end of the tag like this: <select name="myselectname[]" multiple>
    # you have to do the same with checkboxes
    Web4Future Easiest Form2Mail (GPL).
    Copyright (C) 1998-2006 Web4Future.com All Rights Reserved.
    http://www.Web4Future.com/
    This script was written by George L. & Calin S. from Web4Future.com
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
    # DO NOT EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING ===================================================
    $w4fver =  "2.2";
    $ip = ($_SERVER['HTTP_X_FORWARDED_FOR'] == "" ? $_SERVER['REMOTE_ADDR'] : $_SERVER['HTTP_X_FORWARDED_FOR']);
    //function blockIP
    function blockip($ip) {
    $handle = @fopen("blockip.txt", 'a');
    @fwrite($handle, $ip."\n");
    @fclose($handle);
    $w4fx = stristr(file_get_contents('blockip.txt'),getenv('REMOTE_ADDR'));
    if ($serverCheck) {
    if (preg_match ("/".str_replace("www.", "", $_SERVER["SERVER_NAME"])."/i", $_SERVER["HTTP_REFERER"])) { $w4fy = TRUE; } else { $w4fy = FALSE; }
    } else { $w4fy = TRUE; }
    if (($w4fy === TRUE) && ($w4fx === FALSE)) {
    $w4fMessage = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\"><html>\n<head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\"></head><body><font face=3Dverdana size=3D2>";
    if (count($_GET) >0) {
    reset($_GET);
    while(list($key, $val) = each($_GET)) {
      $GLOBALS[$key] = $val;
      if (is_array($val)) {
       $w4fMessage .= "<b>$key:</b> ";
       foreach ($val as $vala) {
        $vala =stripslashes($vala);
        $vala = htmlspecialchars($vala);
        if (trim($vala)) { if (stristr($vala,"Content-Type:") || stristr($vala,"MIME-Version") || stristr($vala,"Content-Transfer-Encoding") || stristr($vala,"bcc:")) { blockip($ip); die("ILLEGAL EXECUTION DETECTED!"); } }
        $w4fMessage .= "$vala, ";
       $w4fMessage .= "<br>\n";
      else {
       $val = stripslashes($val);
       if (trim($val)) { if (stristr($val,"Content-Type:") || stristr($val,"MIME-Version") || stristr($val,"Content-Transfer-Encoding") || stristr($val,"bcc:")) { blockip($ip); die("ILLEGAL EXECUTION DETECTED!"); } }
       if (($key == "Submit") || ($key == "submit")) { } 
       else {  if ($val == "") { $w4fMessage .= "$key: - <br>\n"; }
         else { $w4fMessage .= "<b>$key:</b> $val<br>\n"; }
    } // end while
    }//end if
    else {
    reset($_POST);
    while(list($key, $val) = each($_POST)) {
      $GLOBALS[$key] = $val;
      if (is_array($val)) {
       $w4fMessage .= "<b>$key:</b> ";
       foreach ($val as $vala) {
        $vala =stripslashes($vala);
        $vala = htmlspecialchars($vala);
        if (trim($vala)) { if (stristr($vala,"Content-Type:") || stristr($vala,"MIME-Version") || stristr($vala,"Content-Transfer-Encoding") || stristr($vala,"bcc:")) {blockip($ip); die("ILLEGAL EXECUTION DETECTED!"); } }   
        $w4fMessage .= "$vala, ";
       $w4fMessage .= "<br>\n";
      else {
       $val = stripslashes($val);
       if (trim($val)) { if (stristr($val,"Content-Type:") || stristr($val,"MIME-Version") || stristr($val,"Content-Transfer-Encoding") || stristr($val,"bcc:")) {blockip($ip); die("ILLEGAL EXECUTION DETECTED!"); } }
       if (($key == "Submit") || ($key == "submit")) { } 
       else {  if ($val == "") { $w4fMessage .= "$key: - <br>\n"; }
         else { $w4fMessage .= "<b>$key:</b> $val<br>\n"; }
    } // end while
    }//end else
    $w4fMessage .= "<font size=3D1><br><br>\n Sender IP: ".$ip."</font></font></body></html>";
        $w4f_what = array("/To:/i", "/Cc:/i", "/Bcc:/i","/Content-Type:/i","/\n/");
    $name = preg_replace($w4f_what, "", $name);
    $email = preg_replace($w4f_what, "", $email);
    if (!$email) {$email = $MailToAddress;}
    $mailHeader = "From: $name <$email>\r\n";
    $mailHeader .= "Reply-To: $name <$email>\r\n";
    $mailHeader .= "Message-ID: <". md5(rand()."".time()) ."@". ereg_replace("www.","",$_SERVER["SERVER_NAME"]) .">\r\n";
    $mailHeader .= "MIME-Version: 1.0\r\n";
    if ($sendHTML) {
      $mailHeader .= "Content-Type: multipart/alternative;";  
      $mailHeader .= "  boundary=\"----=_NextPart_000_000E_01C5256B.0AEFE730\"\r\n";    
    $mailHeader .= "X-Priority: 3\r\n";
    $mailHeader .= "X-Mailer: PHP/" . phpversion()."\r\n";
    $mailHeader .= "X-MimeOLE: Produced By Web4Future Easiest Form2Mail $w4fver\r\n";
    if ($sendHTML) {
      $mailMessage = "This is a multi-part message in MIME format.\r\n\r\n";
      $mailMessage .= "------=_NextPart_000_000E_01C5256B.0AEFE730\r\n";
      $mailMessage .= "Content-Type: text/plain;   charset=\"ISO-8859-1\"\r\nContent-Transfer-Encoding: quoted-printable\r\n\r\n";  
      $mailMessage .= trim(strip_tags($w4fMessage))."\r\n\r\n";  
      $mailMessage .= "------=_NextPart_000_000E_01C5256B.0AEFE730\r\n";  
      $mailMessage .= "Content-Type: text/html;   charset=\"ISO-8859-1\"\r\nContent-Transfer-Encoding: quoted-printable\r\n\r\n";  
      $mailMessage .= "$w4fMessage\r\n\r\n";  
      $mailMessage .= "------=_NextPart_000_000E_01C5256B.0AEFE730--\r\n";  
    if ($sendHTML === FALSE) {
      $mailHeader .= "Content-Type: text/plain;   charset=\"ISO-8859-1\"\r\nContent-Transfer-Encoding: quoted-printable\r\n\r\n";  
      $mailMessage .= trim(strip_tags($w4fMessage))."\r\n\r\n";  
    if (!mail($MailToAddress, $MailSubject, $mailMessage,$mailHeader)) { echo "Error sending e-mail!";}
    else { header("Location: ".$redirectURL); }
    } else { echo "<center><font face=verdana size=3 color=red><b>ILLEGAL EXECUTION DETECTED!</b></font></center>";}
    ?>
    Thanks in advance,
    Glenn
    [Subject line edited by moderator to indicate nature of request]

    Using PHP to process an online form and send the input by email is very simple. The mail() function takes a minimum of three arguments, namely: the address the mail is being sent to, the subject line, and the body of the email as a single string. The reason some people use scripts like form2mail.php is because they don't have the knowledge or patience to validate the user input to make sure it's safe to send.
    Rather than attempt to trawl through your complex form looking for the problems, I would suggest starting with a couple of simple tests.
    First of all, create a PHP page called mailtest.php containing the following script:
    <?php
    $to = '[email protected]'; // use your own email address
    $subject = 'PHP mail test';
    $message = 'This is a test of the mail() function.';
    $sent = mail($to, $subject, $message);
    if ($sent) {
      echo 'Mail was sent';
    } else {
      echo 'Problem sending mail';
    ?>
    Save the script, upload it to your server, and load it into a browser. If you see "Mail is sent", you're in business. If not, it probably means that the hosting company insists on the fifth argument being supplied to mail(). This is your email address preceded by -f. Change the line of code that sends the mail to this:
    $sent = mail($to, $subject, $message, null, '[email protected]');
    Obviously, replace "[email protected]" with your own email address.
    If this results in the mail being sent successfully, you will need to adapt the code in form2mail.php to accept the fifth parameter. You need to change the following line, which is a few lines from the end of the script:
    if (!mail($MailToAddress, $MailSubject, $mailMessage,$mailHeader))
    Change it to this:
    if (!mail($MailToAddress, $MailSubject, $mailMessage,$mailHeader, '[email protected]'))
    Again, use your own email address instead of "[email protected]".
    Once you have determined whether you need the fifth argument, test form2mail.php with a very simple form like this:
    <form id="form1" name="form1" method="post" action="form2mail.php">
      <p>
        <label for="name">Name:</label>
        <input type="text" name="name" id="name" />
      </p>
      <p>
        <label for="email">Email:</label>
        <input type="text" name="email" id="email" />
      </p>
      <p>
        <label>
          <input type="checkbox" name="options[]" value="boat cleaning" id="options_0" />
          Boat cleaning</label>
        <br />
        <label>
          <input type="checkbox" name="options[]" value="RV cleaning" id="options_1" />
          RV cleaning</label>
        <br />
        <label>
          <input type="checkbox" name="options[]" value="motorcycle cleaning" id="options_2" />
          Motorcycle cleaning</label>
      </p>
      <p>
        <input type="submit" name="send" id="send" value="Submit" />
      </p>
    </form>
    If that works, you can start to make the form more complex and add back your JavaScript validation.

  • Need help with PHP mail script

    I  have created a  log in system  . In that when the  user completes the  registration process an auto reply(auto-reply@domain)  will generate and  sent this to users email id regarding about the user  name and password  (Lo gin Details). After formal approval from the admin  the user will  get a user activation mail with log in link.
    But , my problem is  these are work only for mail accounts from my  domain  only(test@domain). its not send any of above mentioned details  to other  mail services like gmail or yahoo etc.
    i discussed this   with some others, they said its the problem with your mail function   configuration. but i didn't get any needful information as am a  beginner  in PHP scripting.
    i have contacted this with my  hosting service they said its the  problem with  php mail () function  and use php mailer() instead mail().
    please give me a solution for the same..
    Here am ataching my code..
    <?php
    include 'dbc.php';
    $err = array();
    if($_POST['doRegister'] == 'Register')
    foreach($_POST as $key => $value) {
        $data[$key] = filter($value);
    if(empty($data['full_name']) || strlen($data['full_name']) < 4)
    $err[] = "ERROR - Invalid name. Please enter atleast 3 or more characters for your name";
    //header("Location: register.php?msg=$err");
    //exit();
    // Validate User Name
    if (!isUserID($data['user_name'])) {
    $err[] = "ERROR - Invalid user name. It can contain alphabet, number and underscore.";
    //header("Location: register.php?msg=$err");
    //exit();
    // Validate Email
    if(!isEmail($data['usr_email'])) {
    $err[] = "ERROR - Invalid email address.";
    //header("Location: register.php?msg=$err");
    //exit();
    // Check User Passwords
    if (!checkPwd($data['pwd'],$data['pwd2'])) {
    $err[] = "ERROR - Invalid Password or mismatch. Enter 5 chars or more";
    //header("Location: register.php?msg=$err");
    //exit();
    $user_ip = $_SERVER['REMOTE_ADDR'];
    // stores sha1 of password
    $sha1pass = PwdHash($data['pwd']);
    // Automatically collects the hostname or domain  like example.com)
    $host  = $_SERVER['HTTP_HOST'];
    $host_upper = strtoupper($host);
    $path   = rtrim(dirname($_SERVER['PHP_SELF']), '/\\');
    // Generates activation code simple 4 digit number
    $activ_code = rand(1000,9999);
    $usr_email = $data['usr_email'];
    $user_name = $data['user_name'];
    $rs_duplicate = mysql_query("select count(*) as total from users where user_email='$usr_email' OR user_name='$user_name'") or die(mysql_error());
    list($total) = mysql_fetch_row($rs_duplicate);
    if ($total > 0)
    $err[] = "ERROR - The username/email already exists. Please try again with different username and email.";
    if(empty($err)) {
    $sql_insert = "INSERT into `users`
                  (`full_name`,`user_email`,`pwd`,`address`,`tel`,`fax`,`website`,`date`,`users_ip`,`activa tion_code`,`country`,`user_name`
                VALUES
                ('$data[full_name]','$usr_email','$sha1pass','$data[address]','$data[tel]','$data[fax]',' $data[web]'
                ,now(),'$user_ip','$activ_code','$data[country]','$user_name'
    mysql_query($sql_insert,$link) or die("Insertion Failed:" . mysql_error());
    $user_id = mysql_insert_id($link); 
    $md5_id = md5($user_id);
    mysql_query("update users set md5_id='$md5_id' where id='$user_id'");
    //    echo "<h3>Thank You</h3> We received your submission.";
    if($user_registration)  {
    $a_link = "
    *****ACTIVATION LINK*****\n
    http://$host$path/activate.php?user=$md5_id&activ_code=$activ_code
    } else {
    $a_link =
    "Your account is *PENDING APPROVAL* and will be soon activated the administrator.
    $message =
    "Hello \n
    Thank you for registering with us. Here are your login details...\n
    User ID: $user_name
    Email: $usr_email \n
    Passwd: $data[pwd] \n
    $a_link
    Thank You
    Administrator
    $host_upper
    THIS IS AN AUTOMATED RESPONSE.
    ***DO NOT RESPOND TO THIS EMAIL****
        mail($usr_email, "Login Details", $message,
        "From: \"Member Registration\" <auto-reply@$host>\r\n" .
         "X-Mailer: PHP/" . phpversion());
      header("Location: thankyou.php"); 
      exit();
    ?>

    I  have created a  log in system  . In that when the  user completes the  registration process an auto reply(auto-reply@domain)  will generate and  sent this to users email id regarding about the user  name and password  (Lo gin Details). After formal approval from the admin  the user will  get a user activation mail with log in link.
    But , my problem is  these are work only for mail accounts from my  domain  only(test@domain). its not send any of above mentioned details  to other  mail services like gmail or yahoo etc.
    i discussed this   with some others, they said its the problem with your mail function   configuration. but i didn't get any needful information as am a  beginner  in PHP scripting.
    i have contacted this with my  hosting service they said its the  problem with  php mail () function  and use php mailer() instead mail().
    please give me a solution for the same..
    Here am ataching my code..
    <?php
    include 'dbc.php';
    $err = array();
    if($_POST['doRegister'] == 'Register')
    foreach($_POST as $key => $value) {
        $data[$key] = filter($value);
    if(empty($data['full_name']) || strlen($data['full_name']) < 4)
    $err[] = "ERROR - Invalid name. Please enter atleast 3 or more characters for your name";
    //header("Location: register.php?msg=$err");
    //exit();
    // Validate User Name
    if (!isUserID($data['user_name'])) {
    $err[] = "ERROR - Invalid user name. It can contain alphabet, number and underscore.";
    //header("Location: register.php?msg=$err");
    //exit();
    // Validate Email
    if(!isEmail($data['usr_email'])) {
    $err[] = "ERROR - Invalid email address.";
    //header("Location: register.php?msg=$err");
    //exit();
    // Check User Passwords
    if (!checkPwd($data['pwd'],$data['pwd2'])) {
    $err[] = "ERROR - Invalid Password or mismatch. Enter 5 chars or more";
    //header("Location: register.php?msg=$err");
    //exit();
    $user_ip = $_SERVER['REMOTE_ADDR'];
    // stores sha1 of password
    $sha1pass = PwdHash($data['pwd']);
    // Automatically collects the hostname or domain  like example.com)
    $host  = $_SERVER['HTTP_HOST'];
    $host_upper = strtoupper($host);
    $path   = rtrim(dirname($_SERVER['PHP_SELF']), '/\\');
    // Generates activation code simple 4 digit number
    $activ_code = rand(1000,9999);
    $usr_email = $data['usr_email'];
    $user_name = $data['user_name'];
    $rs_duplicate = mysql_query("select count(*) as total from users where user_email='$usr_email' OR user_name='$user_name'") or die(mysql_error());
    list($total) = mysql_fetch_row($rs_duplicate);
    if ($total > 0)
    $err[] = "ERROR - The username/email already exists. Please try again with different username and email.";
    if(empty($err)) {
    $sql_insert = "INSERT into `users`
                  (`full_name`,`user_email`,`pwd`,`address`,`tel`,`fax`,`website`,`date`,`users_ip`,`activa tion_code`,`country`,`user_name`
                VALUES
                ('$data[full_name]','$usr_email','$sha1pass','$data[address]','$data[tel]','$data[fax]',' $data[web]'
                ,now(),'$user_ip','$activ_code','$data[country]','$user_name'
    mysql_query($sql_insert,$link) or die("Insertion Failed:" . mysql_error());
    $user_id = mysql_insert_id($link); 
    $md5_id = md5($user_id);
    mysql_query("update users set md5_id='$md5_id' where id='$user_id'");
    //    echo "<h3>Thank You</h3> We received your submission.";
    if($user_registration)  {
    $a_link = "
    *****ACTIVATION LINK*****\n
    http://$host$path/activate.php?user=$md5_id&activ_code=$activ_code
    } else {
    $a_link =
    "Your account is *PENDING APPROVAL* and will be soon activated the administrator.
    $message =
    "Hello \n
    Thank you for registering with us. Here are your login details...\n
    User ID: $user_name
    Email: $usr_email \n
    Passwd: $data[pwd] \n
    $a_link
    Thank You
    Administrator
    $host_upper
    THIS IS AN AUTOMATED RESPONSE.
    ***DO NOT RESPOND TO THIS EMAIL****
        mail($usr_email, "Login Details", $message,
        "From: \"Member Registration\" <auto-reply@$host>\r\n" .
         "X-Mailer: PHP/" . phpversion());
      header("Location: thankyou.php"); 
      exit();
    ?>

  • What's simpler than mail merge?

    I have a Pages '09 document which will be used again and again by multiple people. Rather than make them perform a find and replace for each string like, "<%FirstName%>, <%LastName%>, <%Email%>" I wish I could attach a form to the file so that when someone openned it they would have to populate a few text fields one time and upon submition the find and replace would happen for all the various placeholder texts.
    The mail merge feature would be great if I needed a form letter but I don't. The benefit of mail merge would be creating several copies of a pages document populated by the data from rows a numbers file. I don't want to have to teach people how to change the data in a numbers file and make sure that they have it in the proper location on their machine.
    Does anyone know of a simple way to do this? I've looked at several applescript options but the find and replace scripts seem to only apply to body text. My document has body text, text boxes, tables and other types of text that I need replaced.
    Any answers would be greatly appreciated. Even if they are complicated. I'm comfortable trying to figure out Applescript or Automator if those are the only option but I definitely need a push in the right direction.
    Thanks.
    Pete

    Here is the edited script.
    --[SCRIPT open_a_Pages_custom_template_and_fill_fields]
    Enregistrer le script en tant que Script ou Application : open_a_Pages_custom_template_and_fill_fields.xxx
    déplacer le fichier ainsi créé dans le dossier
    <VolumeDeDémarrage>:Users:<votreCompte>:Library:Scripts:
    Aller au menu Scripts, choisir “open_a_Pages_custom_template_and_fill_fields”
    --=====
    L’aide du Finder explique:
    L’Utilitaire AppleScript permet d’activer le Menu des scripts :
    Ouvrez l’Utilitaire AppleScript situé dans le dossier Applications/AppleScript.
    Cochez la case “Afficher le menu des scripts dans la barre de menus”.
    Sous 10.6.x,
    aller dans le panneau “Général” du dialogue Préférences de l’Éditeur Applescript
    puis cocher la case “Afficher le menu des scripts dans la barre des menus”.
    --=====
    Save the script as a Script or an Application : open_a_Pages_custom_template_and_fill_fields.xxx
    Move the newly created file into the folder:
    <startup Volume>:Users:<yourAccount>:Library:Scripts:
    Go to the Scripts Menu, choose “open_a_Pages_custom_template_and_fill_fields”
    --=====
    The Finder’s Help explains:
    To make the Script menu appear:
    Open the AppleScript utility located in Applications/AppleScript.
    Select the “Show Script Menu in menu bar” checkbox.
    Under 10.6.x,
    go to the General panel of AppleScript Editor’s Preferences dialog box
    and check the “Show Script menu in menu bar” option.
    --=====
    Yvan KOENIG (VALLAURIS, France)
    2011/04/29 -- modified at 23:00:06 according to OP's request
    --=====
    true = open a predefined custom template
    false = open the custom template selected thru Choose From List
    property use_predefined_template : true
    Edit this property to fit your needs. You may change the strings or their number.
    The unique requirement is to keep the first two and the last two characters.
    property field_names : {"<%Error Title%>", "<%Error Type%>", "<%Unit ID%>"} --
    --=====
    on run
              my activateGUIscripting()
      run script do_your_duty
      --my do_your_duty()
    end run
    --=====
    script do_your_duty
      --on do_your_duty()
              local templates_loc, myTemplates_loc, chemin_des_modeles, le_modele, mon_modele
              local nb_chiffres, entire_contents, indx, chemin_de_mes_modeles, noms_de_mes_modeles, le_conteneur, i, un_element, le_titre, mon_choix
              set field_values to {}
              repeat with i from 1 to count of field_names
                        set field_name to item i of field_names
                        set le_prompt to "Enter the string to fill the field " & field_name
                        set maybe to text returned of (display dialog le_prompt default answer (text 3 thru -3 of field_name))
                        copy maybe to end of field_values
              end repeat
    Grab the localized names of the templates folders *)
              tell application "Pages"
                        my close_palettes()
                        set templates_loc to localized string "Templates"
                        set myTemplates_loc to localized string "My Templates"
              end tell -- to application a
    Define the path to the folder storing custom templates *)
              set chemin_des_modeles to "" & (path to library folder from user domain) & "Application Support:iWork:Pages:" & templates_loc & ":" & myTemplates_loc & ":"
              if use_predefined_template then
    Here, use a predefined custom template
                        set le_modele to "merge_in_it.template" --<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
                        set mon_modele to chemin_des_modeles & le_modele
              else
    Here, use a Choose from list dialog to define the template to use
                        set nb_chiffres to 3 (* 
    2 = allow 99 templates
    3 = allow 999 templates *)
    Grab the list of every items stored in the folder *)
                        tell application "Finder"
                                  set entire_contents to entire contents of folder chemin_des_modeles
                        end tell
    Build two lists. One contain the path to every custom templates.
    The other contain the names of these templates and the names of subfolders *)
                        set indx to 1
                        set chemin_de_mes_modeles to {}
                        set noms_de_mes_modeles to {}
                        set le_conteneur to ""
                        tell application "System Events"
                                  repeat with i from 1 to count of entire_contents
                                            set un_element to item i of entire_contents as text
                                            try
                                                      if type identifier of disk item un_element is in {"com.apple.iwork.Pages.template", "com.apple.iwork.Pages.sfftemplate"} then
                                                                if name of container of disk item un_element is not le_conteneur then
                                                                          set le_conteneur to name of container of disk item un_element
                                                                          copy (text 1 thru nb_chiffres of "---") & space & le_conteneur to end of noms_de_mes_modeles
                                                                end if
                                                                copy un_element to end of chemin_de_mes_modeles
                                                                copy text -nb_chiffres thru -1 of ("00" & indx) & space & name of disk item un_element to end of noms_de_mes_modeles
                                                                set indx to indx + 1
                                                      end if
                                            end try
                                  end repeat
                        end tell
                        if my parleAnglais() then
                                  set le_titre to "Pages’s custom templates"
                        else
                                  set le_titre to "Modèles personnalisés de Pages"
                        end if
    Choose the template to use.
    If you select a subfolder name, the script beep and ask one more time *)
                        repeat
                                  set mon_choix to choose from list noms_de_mes_modeles with title le_titre
                                  if mon_choix is false then error number -128
                                  try
                                            set mon_choix to text 1 thru nb_chiffres of (item 1 of mon_choix) as integer
                                            exit repeat
                                  on error
                                            beep 1
                                  end try
                        end repeat
                        set mon_modele to (item mon_choix of chemin_de_mes_modeles)
              end if
    Create a new document from the selected template *)
              tell application "Pages"
      open file mon_modele
                        tell document 1
                        end tell
                        repeat with i from 1 to count of field_names
                                  my Rechercher_Remplacer(item i of field_names, item i of field_values)
                        end repeat
              end tell -- Pages
      --end do_your_duty
    end script
    --=====
    on parleAnglais()
              local z
              try
                        tell application "Pages" to set z to localized string "Cancel"
              on error
                        set z to "Cancel"
              end try
              return (z is not "Annuler")
    end parleAnglais
    --=====
    on activateGUIscripting()
      (* to be sure than GUI scripting will be active *)
              tell application "System Events"
                        if not (UI elements enabled) then set (UI elements enabled) to true
              end tell
    end activateGUIscripting
    --=====
    on Rechercher_Remplacer(avant, |après|)
              local nom_du_dialog
              tell application "Pages" to activate
              tell application "System Events" to tell application process "Pages"
      keystroke "f" using {command down}
                        set nom_du_dialog to title of window 1
                        tell window nom_du_dialog to tell (first UI element whose role is "AXTabGroup")
                                  set value of first text area of first scroll area to avant
                                  set value of first text area of last scroll area to |après|
                                  if (count of checkbox) = 0 then
    Simple dialog *)
                                            set {X_bouton, Y_bouton} to position of last button
                                  else
    Advanced dialog *)
                                            set {X_bouton, Y_bouton} to position of button -3
                                  end if
                        end tell -- window nom_du_dialog…
                        click at {X_bouton + 5, Y_bouton + 5}
      keystroke "w" using {command down} -- Close the dialog
              end tell -- System Events…
              return
    end Rechercher_Remplacer
    --=====
    on close_palettes()
              local w, buttonX, buttonY, buttonW, buttonH
              tell application "Pages" to activate
              tell application "System Events" to tell application process "Pages"
                        set frontmost to true
                        repeat with w from (count of windows) to 1 by -1
                                  tell window w
                                            if (subrole is not "AXStandardWindow") then
                                                      tell first button to set {{buttonX, buttonY}, {buttonW, buttonH}} to {position, size}
                                                      click button 1 at {buttonX + (buttonW div 2), buttonY + (buttonH div 2)}
                                            end if
                                  end tell
                        end repeat
              end tell
    end close_palettes
    --=====
    --[/SCRIPT]
    Yvan KOENIG (VALLAURIS, France) vendredi 29 avril 2011 23:01:47
    Please :
    Search for questions similar to your own before submitting them to the community

  • CDO Mail Sending

    Hi Guys,
    Wondering if anyone can guide me in the correct direction
    with this. Each time I include the CStr lines in this script I get
    a server error.
    I need to be able to get the values from a form into this
    email..if I hard code it it works, i.e i remove the
    objMail.CStr(Request ("Notes")
    this is my script :
    <!--METADATA TYPE="typelib"
    UUID="CD000000-8B95-11D1-82DB-00C04FB1625D"
    NAME="CDO for Windows 2000 Library" -->
    <!--METADATA TYPE="typelib"
    UUID="00000205-0000-0010-8000-00AA006D2EA4"
    NAME="ADODB Type Library" -->
    <%
    if(CStr(Request("Submit"))<> "") Then
    Dim objMail
    Set objMail = Server.CreateObject("CDO.Message")
    Set objConfig = Server.CreateObject("CDO.Configuration")
    'Configuration:
    objConfig.Fields(cdoSendUsingMethod) = cdoSendUsingPort
    objConfig.Fields(cdoSMTPServer)="mySMTP"
    objConfig.Fields(cdoSMTPServerPort)=25
    objConfig.Fields(cdoSMTPAuthenticate)=cdoBasic
    objConfig.Fields(cdoSendUserName) = "xxxxxxxxxxxx"
    objConfig.Fields(cdoSendPassword) = "xxxxxxxxxx"
    'Update configuration
    objConfig.Fields.Update
    Set objMail.Configuration = objConfig
    objMail.From ="[email protected]"
    objMail.To = "[email protected]"
    objMail.Subject = CStr(Request("Email"))'Email address
    objMail.Body = CStr(Request("Notes")) 'Notes
    objMail.Subject ="Website Enquiry"
    objMail.TextBody="This is to let you know a users has just
    added details to our database"
    objMail.Send ()
    if Err.Number = 0 Then
    Response.Write("Mail sent")
    Else
    response.write("Error Sending Mail.Code: " & Err.Number)
    Err.Clear
    End if
    End if
    Set objMail = Nothing
    Set objConfig=Nothing
    %>
    Any help would be most appreciated...I want/need to get this
    completed for use tomorrow.
    Thanks

    https://support.microsoft.com/en-us/kb/171440?wa=wsignin1.0
    "Error loading library" is your first error, all others are just follow up, as you surely have code WITH..ENDWITH using the CDO object, which couldn't be instanciated. You should expand your error handler to show more info, you can show PROGRAM()
    and LINENO().
    Anyway, the solution is not to install CDO, as the situation is so complex about prerequisites and incompatibilities, eg read the notes. The solution is to use something different. I pointed you to a wiki article listing about 20 alternatives.
    Bye, Olaf.
    Olaf Doschke - TMN Systemberatung GmbH
    http://www.tmn-systemberatung.de

  • Trying to create or find a mail script

    I find myself often missing important emails. Is there a cript available or can someone show me how to create a script that would open emails when received from particular emails...I am a NOOB when it comes to scripting...
    Thanks a lot!

    Mail.app > Mail > Preferences... > Rules > add a rule for relocating or flagging or forwarding or bouncing the Mail.app icon in the Dock or otherwise processing in response to a particular mail message. 
    Rather than opening the message (as having random stuff popping open windows gets... well... frustrating), I'd probably color the message and/or move it to a specific mailbox and/or play a sound, and might bounce the Mail.app icon in the Dock.  Simple, fast, with no scripting required; it just works...
    What's available within the rules by default is flexible, though that can be extended further by invoking a script from a rule, and some folks use this for fairly complex scripts including for processing the message contents.

Maybe you are looking for

  • ORA-12801 ORA-08103 while running gather schema stats in R12

    Hi All, We have recently upgraded from 11.5.9 to R12.1.1 on RHEL 4.8 Database version is 10.2.0.5 We are running Gather schema stats on R12.1.1 but its Errored out with below messages. ORA-12801: error signaled in parallel query server P006 GL.GL_JE_

  • Inconsistent data when exporting measurement markup to Excel?

    I use Adobe Acrobat XI Pro on a Windows 7 Dell PC to create Commercial Landscape takeoff's from architectural drawings. After setting the appropriate scale under 'Change Scale Ratio' and then using the measurement tools to outline, color code, and la

  • Message Missing Properties : [serviceURL]

    Hi All, I have been trying to setup Oracle EM to monitor my OSB Domain. I installed the Oracle Grid Control on a separate server and then installed the Agent on the Target Machine where i have my Oracle OSB Domain. Once i conifgured my Oracle Domain

  • Adobe Flash player plugin keeps crashing/Updating not working.

    Almost everyday the plug-in keeps crashing which is very annoying. Updating it did not work as there are missing plug-ins and when installing them, you have to install by manual but when downloaded theres no way to open and run the missing plug-in

  • Reference ICWC

    Hi I am using the example Page No 88 of CookBook here is little code data: lr_bdc    type ref to cl_crm_ic_cucobdc_impl,          lr_btorder type ref to if_bol_bo_property_access. lr_bdc ?= me->get_custom_controller( 'CuCoBDC' ).       //here it is g