Emailing a form using PHP5

I'm trying to send an email with PHP5 from my local computer,
apache, and php5
I keep getting a STARTTLS error. trying to us gmail to
send...any ideas?

Steve wrote:
> On Sat, 25 Nov 2006 05:35:31 +0000 (UTC), "South Beach"
> <[email protected]> wrote:
>
>> I'm trying to send an email with PHP5 from my local
computer, apache, and php5
>>
>> I keep getting a STARTTLS error. trying to us gmail
to send...any ideas?
>
> Have you set up sendmail correctly?
Another consideration is that gmail requires a username and
password.
PHP mail() function does not support SMTP authentication. To
send a
username and password to gmail, you need to use a custom
class like
PHPMailer.
David Powers
Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
http://foundationphp.com/

Similar Messages

  • Email a form using PHP works intermittently

    Hello all,
    I'm using DW CS6/ Win 7. I have created a simple subscription form where the user enters their email and the form is emailed to an administrator. Sometimes it works and sometimes it doesn't and I have no idea why. Occasionally I  receive the email after a delay of several minutes and sometimes it never arrives. The webpage is here www.sanbenitoolivefestival.com/contactus2.php , below is the script , I've tried in IE and FF, same intermittent results. I'm new to FF/ Firebug but it didn't report any errors that I could see
    <div class="subscribe">
        <div class="spacer"></div>
    <?php
    if ((isset($_REQUEST['email'])) && ($_REQUEST['email'] != " Enter Email Address"))
    //if "email" is filled out, send email
        echo "sending mail";
        //send email
       $email = $_REQUEST["email"] ;
       $subject = "SBOF EMAIL SUBSCRIPTION REQUEST" ;
       $message = "Please add my email address to the SBOF email subscription list" ;
       mail("[email address removed by moderator]", $subject,
       $message, "From:" . $email);
       echo "Thank you, we have sent your subscription request";
    else
    //if "email" is not filled out, display the form
       echo '<form action="contactus2.php" method="post" >
         <em>Stay in touch by joining our email list.                  
          <input name="email" type="text" value=" Enter Email Address" size="42"  class="input" />         
         <input name="submit" type="submit" value="   SUBSCRIBE  " class="button"/>
          </em>
        </form>';
    ?>
    </div>

    You are using an extremely insecure technique that lays your form wide open to a malicious attack known as email header injection, which can turn your form into a spam relay.
    You should NEVER use unfiltered form input in the email headers. The From header is intended to indicate who sent the email. In this case, it's your website, not the person who fills out the form. If you want the convenience of hitting the reply button in your email program to use the sender's email address, you should use the Reply-to header instead of From.
    Misusing the From header like this is one possible cause of your emails not getting through. You should also check with your hosting company to see if they require the fifth argument to mail() to be set. This is normally a string that begins with -f followed immediately by a known email address on the same domain as the server, for example '[email protected]'.
    Also, using $_REQUEST is insecure.
    Change your code like this:
    <?php
    if ((isset($_POST['email'])) && ($_POST['email'] != " Enter Email Address"))
    //if "email" is filled out, send email
        // make sure the email is OK
        $email = filter_input(INPUT_POST, 'email', FILTER_VALIDATE_EMAIL);
        // send the message only if the email address is valid
        if ($email) {
            echo "sending mail";
            //send email
            $from = '[email protected]';  // this should be your own email address
            $subject = "SBOF EMAIL SUBSCRIPTION REQUEST" ;
            $message = "Please add my email address to the SBOF email subscription list" ;
            $headers = "From: $from\r\nReply-to: $email";
            $sent = mail("[email address removed by moderator]", $subject,
                $message, $headers);
            if ($sent) {
                echo "Thank you, we have sent your subscription request";
           } else {
                echo 'Sorry, there was a problem sending your request';
    else
    //if "email" is not filled out, display the form
       echo '<form action="contactus2.php" method="post" >
         <em>Stay in touch by joining our email list.                 
          <input name="email" type="text" value=" Enter Email Address" size="42"  class="input" />        
         <input name="submit" type="submit" value="   SUBSCRIBE  " class="button"/>
          </em>
        </form>';
    ?>

  • Sending email from forms using 'from'

    I'm trying to send an email from forms. It goes well, but I like to use the 'from' field from Outlook. How can I use it in OLE? I have searched everywhere, but can't find it.
    It seems to me it is something like the way you do with BCC and CC options, but I haven't found a way to do the same thing with the From field. Can anyone help?
    Thanks,
    Pauline Kooy

    Fabrizio,
    Are you just sending the Line Feed character 'CHR(10)"? I typically send the Carrage Return character 'CHR(13)' as well. I'll create a variable called CRLF and assign the Carrage Return and Line Feed characters to this variable. Then reference the CRLF variable when I want to embed a new line.
    For example:
    DECLARE
       crlf         VARCHAR2(2) := chr(13)||chr(10);
       v_msg_body   VARCHAR2(2000);
    BEGIN
       v_msg_body := 'lots of text here'||crlf;
    END;Hope this helps.
    Craig...

  • Email from form using developer 6i

    Hi,
    Could anybody help me to resolve the below mentioned problem. I wanted to call "Outlook" Mailto: from a form where my email address is entered. How can I do this in forms 6i.
    PG Anil.

    I'm not sure what you mean by the "SQL Net client" not being compatible.
    We have one client using Oracle 11g and one on Oracle 9. I can still connect and test all of our Forms 6i client/server forms to BOTH databases and run tests successfully.
    As long as the new database is not using the AL32UTF8 character set, and Forms users have all Upper-case passwords, all seems to work ok.
    Edit: Following tony.g's note below: I have Patch 18 installed on Forms 6i, so it runs version 6.0.8.27.0
    Edited by: Steve Cosner on Oct 31, 2012 9:38 AM

  • How does general web public email the form using reader only

    After producing a form in Designer no one was able to email the filled in form back. Is there some very basic step I missed? I had a submit button with my email address entered yet everyone with reader was unable to get the form emailed. If I didn't miss something I guess I don't see the point of creating the form if you need a full version to respond.....

    I did upgrade one of the testers to Reader 7 and it worked. I may have to save the form in two files one for 7 and one for Reader6. The submit by email did function but I had also changed the button and used the one from the Library and set the address to mailto:myemailaddress. What that did was return a .tmp file. So I dragged in a default button from a new file and that corrected it - that one seems to not have the 'mailto' prefix and must have some built in coding to return the data in XML.
    Submiting the data to a server doesn't make much sense unless you have some method of getting the data from the server. Is there such a method built into this program or does that require additional coding?

  • Emailing from Forms using OLE2....Critical problem

    Dear All,
    I > Iam sending Email thru ole2 from Forms6i. The whole business process is in LAN/WAN. The email process calls ms-outlook. But in some m/c although the report gets generated , nothing is sent to outbox.
    Do i need a MAPI profile to be installed in Outlook.Even if i installed a MAPI profile
    its giving a error messg ' Exchange server can't be found'.
    whats the issue can any one tell me ????
    2> Also if i bypass OLE2 and generate the report in pdf and email from report runtime thru the 'mail menu' it calls outlook express.But i want to fix the subject and report name in the outlook express.Its coming as default system generated.
    Can it be changed in any setting ???
    regards,

    i does not have any idea for sending mail from ole2 but i send the mails using the demo mail package.

  • When a user emails a form using a button, the spaces in the file name change to %20. How can I keep the spaces?

    The button is using javascript. I know I could use underscores and hyphens, but spaces would be best. All I see is how you can't use spaces in URLs, but this is a file name, so I don't understand why it converts it to %20.

    You cannot. the "%20" indicates the hexadecimal (base 16) character number for a space.

  • Email form using JavaScript

    I would like to perform certain validations when user clicks the email button. However, I am unable to enter any JavaScript in the click event. This event is disabled.
    Is there a way to email a form using JavaScript (not through the Submit tab)? This way I can run the validations in the click event, before emailing the form.
    Any other suggestions are welcome.
    Thanks
    Aditya

    Aditya,
    A common solution is to use two buttons. Add a Email Submit Button object and define the presence as 'invisible'. Let's name the object 'EmailSubmitBtn'. Add a Button object and change the caption to 'Email'. Let's call the object 'EmailBtn'. One the 'EmailBtn' click event perform the required validations and then call the click event on the 'EmailSubmitBtn'. You call the 'EmailSubmitBtn' click event as follows:
    form1.subform1.EmailSubmitBtn.execEvent("click");
    Steve

  • Offline Interactive PDF Forms Using EMail with WebDynpro for ABAP

    These is a tutorial on implementing Offline Interactive PDF Forms using Email to both send out and receive the form back using WebDynpro for Java.
    Is it possible to implement the same using WebDynpro for ABAP, specifically receiving the forms via email server.
    Regards,
    Mark

    Hi Mark,
    Check this out :
    https://www.sdn.sap.com/irj/sdn/interactiveforms-elearning
    Go to section :
    Send, Receive, and Process Interactive Forms via Email in SAP NetWeaver Application Server ABAP (RIG session 4A)
    and for the ABAP WebDynpro :
    SAP Interactive Forms by Adobe in Web Dynpro for ABAP (Session 3A) .
    I managed to make it work in my internal sytem.
    Goodluck.
    Cheers,
    Danny

  • I downloaded a form and saved as pdf yet cannot attach to email, says in use but all are closed help!

    i downloaded a form and saved as pdf yet cannot attach to email, says in use but all are closed help!

    for the moment you can Forcequit, as Eustace said.
    Really quit a program you do by clicking the menu bar of the program where its name is, on the bottom you see "Quit (appname)"; when it is in the Dock, rightclick it in the Dock and choose "Quit".
    Now about yout attachment: it does not matter what you did to it and where you moved it, as long as Preview is still open it doesn't let it go.

  • I filled out a pdf form using my ipad adobe reader.  When I email/print it is blank..without answers

    I filled out a pdf form using my ipad adobe reader.  When I email/print it is blank..without answers?  Help!

    I have the same issue now with the newest update...the iOS 7 design update now wont allow edited PDF's inside of this app to print with the forms filled out...so now all the usage i have for this app is GONE...
    I am so angry...you dont have any clue how mad I am...cant email them to me or print to airprint with forms filled
    Someone please tell me there is a fix...PDF's i created with the app before the update are fine...they are all there and can be printed with forms filled but new ones dont...please say there is a fix

  • Email Dynamic Form as Attachment using class cl_bcs?

    Hi Experts
    I really hope that you can help me.
    I have a dynamic form embedded in my view and I need to email this form as an attachment to a list of participants.
    I already use the class cl_bcs for sending email, but how do I retrieve the form parameters (on button click within WD ABAP) and then convert them to the correct format so that they can be included in the cl_bcs class for sending?
    Thanks in advance
    I'll award points to helpful answers.
    Anton Kruse

    HI,
    To send mail with PDF attachement,
    U have to specify the emporting and exporting parameters for the Interactive Form in the SFP transaction.
    Then add the below coding,
    *Send mail in PDF format
    Funtion module to get the generated FM name
          TRY.
              CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'
                EXPORTING
                  i_name     = lc_formname
                IMPORTING
                  e_funcname = lv_fmname.
            CATCH cx_fp_api_repository.                     "#EC NO_HANDLER
            CATCH cx_fp_api_usage.                          "#EC NO_HANDLER
            CATCH cx_fp_api_internal.                       "#EC NO_HANDLER
          ENDTRY.
          ls_param-nodialog = 'X'." suppress printer dialog popup
          ls_param-getpdf   = 'X'." launch print preview
          CALL FUNCTION 'FP_JOB_OPEN'
            CHANGING
              ie_outputparams = ls_param
            EXCEPTIONS
              cancel          = 1
              usage_error     = 2
              system_error    = 3
              internal_error  = 4
              OTHERS          = 5.
          IF sy-subrc <> 0.
    Do Nothing
          ENDIF.
          ls_fp_doc-langu    = lc_sprsl.
          ls_fp_doc-country  = lc_country.
          ls_fp_doc-fillable = 'X'.
    Mail Format /1BCDWB/SM00000091
          CALL FUNCTION lv_fmname
            EXPORTING
              /1bcdwb/docparams  = ls_fp_doc
              empno              = ls_emp_det-empno
              empname            = ls_emp_det-empname
              state              = ls_emp_det-state
              location           = ls_emp_det-location
              organisation       = ls_emp_det-organisation
              position           = ls_emp_det-position
              mailid             = ls_emp_det-mailid
              actual_date        = ls_emp_det-actual_date
              likely_date        = ls_emp_det-likely_date
              resig_date         = ls_emp_det-resig_date
              generic_det        = lt_generic
              bond_det           = lt_bond
            IMPORTING
              /1bcdwb/formoutput = ls_formout
            EXCEPTIONS
              usage_error        = 1
              system_error       = 2
              internal_error     = 3
              OTHERS             = 4.
          IF sy-subrc <> 0.
    *do nothing.
          ENDIF.
          CALL FUNCTION 'FP_JOB_CLOSE'
            EXCEPTIONS
              usage_error    = 1
              system_error   = 2
              internal_error = 3
              OTHERS         = 4.
          IF sy-subrc <> 0.
    Do Nothing
          ENDIF.
    *Function call to get the xstring value.
          CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
            EXPORTING
              buffer     = ls_formout-pdf
            TABLES
              binary_tab = lt_att_content_hex."PDF file from function module
          lv_bodytext_row-line = lc_subject.
          APPEND lv_bodytext_row TO lt_bodytext.
          APPEND ' ' TO lt_bodytext.
          lv_bodytext_row-line = text-001.
          APPEND lv_bodytext_row TO lt_bodytext.
          APPEND ' ' TO lt_bodytext.
          DESCRIBE TABLE lt_bodytext LINES lv_num_rows.
          lv_num_rows = lv_num_rows * 255.
          MOVE lv_num_rows TO lv_textlength.
          TRY.
              lv_attdoctype = lc_pdf.
              lv_atttitle = text-000.
              lc_document = cl_document_bcs=>create_document(
              i_type = lc_raw
              i_text = lt_bodytext
              i_length = lv_textlength
              i_subject = lv_subject ).
              lc_document->add_attachment( EXPORTING
              i_attachment_type     = lv_attdoctype
              i_attachment_subject  = lv_atttitle
              i_attachment_language = sy-langu
              i_att_content_hex     = lt_att_content_hex ). This will attach ur PDF to mail
    Create persistent send request
              lv_send_request = cl_bcs=>create_persistent( ).
    Add document to send request
              lv_send_request->set_document( lc_document ).
              lv_sender = cl_sapuser_bcs=>create( sy-uname ).
    Add sender
              CALL METHOD lv_send_request->set_sender
                EXPORTING
                  i_sender = lv_sender.
              CLEAR : ls_smtp_addr.
         READ TABLE lt_mailid INTO ls_mailid WITH KEY pernr = ls_0001-pernr.
              IF sy-subrc = 0.
                ls_smtp_addr = ls_mailid-usrid_long.
              ENDIF.
    Create recipient.
             lv_recipient    = cl_cam_address_bcs=>create_internet_address(
                                                          ls_smtp_addr ).
    Add recipient with its respective attributes to send request
              lv_send_request->add_recipient( EXPORTING
                            i_recipient = lv_recipient
    Set send immediately
              lv_send_request->set_send_immediately( 'X' ).
    Send document
              lv_send_request->send( ).
            CATCH cx_root INTO lv_oref.                     "#EC NO_HANDLER
          ENDTRY.
    Hope this ll help u!!
    Thanks,
    Divya.S

  • I NEED HELP! Making a flash email form using php.

    Hi, my name is Sean, I'm making a flash contact form using php for a website.
    I'm having a hard time with the php. Can some one help?
    Click here to download my source.

    Satellite A505-S6005 
    ACPI Flash BIOS version 1.40 for Satellite A500/A505 (PSAT6U/PSAT9U)
    When you execute the download file (sat6v140.exe) it decompresses into several files in the sat6v140 folder. 
    Among those, is the readme.txt attached, which explains how to create the CD.
       Burn a CD or DVD from an ISO file
    -Jerry
    Attachments:
    readme.txt ‏14 KB

  • How do you construct a web form using coldfusion??

    How do you construct a web form using coldfusion?? any
    examples?
    thanks in adv.

    A sample Form:
    <cfform action="CCARProc.cfm"
    enctype="multipart/form-data" method="post" name="CCAR"
    onsubmit="return verify()">
    <table width="730" border="0" cellpadding="2"
    cellspacing="1" align="center" class="unnamed1">
    <!--DWLayoutTable-->
    <tr valign="top">
    <td colspan="3" bgcolor="#F2F2F2">Name Of
    Requester(<font color="red">*</font>)</td>
    <td width="402" bgcolor="#F2F2F2"><cfinput
    type="text" name="Requestor_Name" size="15" value="#REQNAME#"
    maxlength="25" >
     MTABT Email(<font
    color="red">*</font>) 
    <cfinput name="Req_Email" type="text" size="8"
    maxlength="20" value="#ReqEmail#"
    >@mtabt.org</td></tr>
    <tr>
    <td colspan="3">Requester Telephone #(<font
    color="red">*</font>) </td>
    <td><cfinput type="text" VALUE="#REQPHONE#"
    name="RPhone" size="12" maxlength="12" message="Requester Phone
    cannot be blank / Invalid Entry!" required="yes"
    validate="telephone"> [e.g. xxx xxx xxxx or
    xxx-xxx-xxxx]</td>
    </tr>
    <tr>
    <td colspan="3" bgcolor="#F2F2F2">Facility(<font
    color="red">*</font>)</td>
    <td bgcolor="#F2F2F2">
    <cfselect name="Facil">
    <option value="2B">2B </option>
    <option value="BBT">BBT </option>
    <option value="BW">BW </option>
    <option value="CB">CB </option>
    <option value="HH">HH </option>
    <option value="MP">MP </option>
    <option value="QMT">QMT </option>
    <option value="RI">RI </option>
    <option value="TM">TM </option>
    <option value="TB">TB </option>
    <option value="TN">TN </option>
    <option value="VN">VN </option>
    </cfselect>
    </td>
    </tr>
    <tr>
    <td colspan="3">Department(<font
    color="red">*</font>)</td>
    <td><cfselect name="Dept">
    <option value="Contracts">Contracts </option>
    <option value="Engineering">Engineering
    </option>
    <option value="Executive Office">Executive
    Office</option>
    <option value="Finance">Finance </option>
    <option value="General Counsel">General Counsel
    </option>
    <option value="HS">HS </option>
    <option value="HR">HR </option>
    <option value="ISD">ISD</option>
    <option value="Legal">Legal </option>
    <option value="Labor Relations">Labor Relations
    </option>
    <option value="Operations">Operations </option>
    <option value="Payroll">Payroll </option>
    <option value="Planning & Budget">Planning &
    Budget </option>
    <option value="Procurement & Mtrl">Procurement
    & Mtrl </option>
    <option value="Purchasing">Purchasing </option>
    <option value="Revenue Management">Revenue Management
    </option>
    <option value="Staff Services">Staff Services
    </option>
    <option value="SD">SD</option>
    <option value="Technology">Technology</option>
    </cfselect></td>
    </tr>
    <tr>
    <td colspan="3" bgcolor="#F2F2F2">Division(<font
    color="red">*</font>)</td>
    <td bgcolor="#F2F2F2"><cfinput name="Div"
    type="text" size="20" maxlength="25" VALUE=""></td>
    </tr>
    <tr valign="top">
    <td height="27" colspan="3" >Justification(<font
    color="red">*</font>)</td>
    <td bgcolor=""><textarea name="Justi" cols="50"
    rows="3" wrap="VIRTUAL" ></textarea> </td>
    </tr>
    <tr>
    <td colspan="3" bgcolor="#F2F2F2">VP Approval
    By (<font color="red">*</font>)</td>
    <td bgcolor="#F2F2F2"><cfinput name="VPAppFName"
    type="text" size="20" maxlength="25" VALUE="#VPFName#">
         MTABT
    Email(<font color="red">*</font>) 
    <cfinput name="VPE" type="text" size="8" maxlength="20"
    value="#VPEmail#" >@mtabt.org</td>
    </tr>
    <tr>
    <td colspan="3" valign="top"
    bgcolor="#F2F2F2"></td>
    <td colspan="2" rowspan="2" valign="top"
    bgcolor="#F2F2F2"><div align="left">
    <input name="Submit" type="submit" value="SubmitTheForm"
    class="button"
    style="font-size='10pt';color='#663399';font-face='Arial,
    Helvetica, sans-serif';" >
    <input name="Reset" type="reset" value="ReSetTheForm"
    class="button"
    style="font-size='10pt';color='#663399';font-face='Arial,
    Helvetica, sans-serif';">
    </div></td>
    <td width="90" valign="top"
    bgcolor="#F2F2F2"></td>
    </tr>
    </table>
    <div align="right"><span class="style4">Revised(
    01.28.05 )</span>
    <input name="submitDate" type="hidden"
    value="<cfoutput>#DateFormat(Now(),'mm/dd/yy')#</cfoutput>">
    </div>
    </cfform>

  • How do I get multiple people to sign a PDF form using a Touchscreen PC?

    I have created a PDF form, using Acrobat XI Pro, to record a client training session. The form is being completed using Adobe Reader (on a Panasonic Touchbook running Windows 7), so I have extended it to allow saving and signing. On the form I have a digital signature field for each trainee (next to a text field for their name) and a digital signature field for the trainer.
    Creating a proper digital signature, signable using a password, is fine for the trainer, but the trainees will only be seen once. Often/usually they do not have email addresses so emailing for a signature, using EchoSign/DocuSign is out, but I have a touch-screen computer so should just be able to pass it round for a quick signature. Also, the form will be completed offline, with the trainer turning up on a site, not having access to the internet.
    Clicking on the signature field does not provide a way to create the handwritten signature, and although the sign tab shows EchoSign in Adobe reader, allowing you to create such a signature this is shown as disabled (I imagine because I have extended the form).
    This is the last piece to the puzzle. Any ideas?
    Thank,
    Len
    p.s. I did see a version using a flash object on ADEP 10, http://forums.adobe.com/message/3998457#3998457 but this seems a little hacky, plus I would prefer to use acrobat Pro because it does everything else I want it to do.

    I have created a PDF form, using Acrobat XI Pro, to record a client training session. The form is being completed using Adobe Reader (on a Panasonic Touchbook running Windows 7), so I have extended it to allow saving and signing. On the form I have a digital signature field for each trainee (next to a text field for their name) and a digital signature field for the trainer.
    Creating a proper digital signature, signable using a password, is fine for the trainer, but the trainees will only be seen once. Often/usually they do not have email addresses so emailing for a signature, using EchoSign/DocuSign is out, but I have a touch-screen computer so should just be able to pass it round for a quick signature. Also, the form will be completed offline, with the trainer turning up on a site, not having access to the internet.
    Clicking on the signature field does not provide a way to create the handwritten signature, and although the sign tab shows EchoSign in Adobe reader, allowing you to create such a signature this is shown as disabled (I imagine because I have extended the form).
    This is the last piece to the puzzle. Any ideas?
    Thank,
    Len
    p.s. I did see a version using a flash object on ADEP 10, http://forums.adobe.com/message/3998457#3998457 but this seems a little hacky, plus I would prefer to use acrobat Pro because it does everything else I want it to do.

Maybe you are looking for

  • How do you use Logical Expressions in the RTF?

    How do you use logical expressions such as "and", "or" when you want to do conditional printing of XML data in the RTF? For example: if (conditionA and conditionB) then... Regards, Smita

  • Flex Tree does not selecting (highlight) the selectedIndices

    have an array of items that should be selected in my tree control. As you can see from my code below,I bind this array to the selectedIndices property of the tree. The selectedItems are not properly selecting in tree(selecting some other items and al

  • Quicktime 7 Problem on RTSP Server

    We're having problems with movies streamed from our rtsp server, starting with the release of Quicktime 7. Suddenly, Quicktime movies display no video, only the audio track, (transport bar shows up in the middle of the screen). This problem shows up

  • Audigy 2 ZS - He

    A few days ago i formated my computer for the first time. Everything worked fine until I was going to install my soundcard drivers (Audigy 2 ZS). I start the install from the orinigal CD but after the setup shield wizard i get this message: <EM>"Setu

  • My view on EJBs

    http://www.greengiraffesolutions.blogspot.com/