E-mail(UTL_SMTP) From Oracle9i?

Hi Friends,
I'm trying to e-mail (from PL/SQL Procedure) to hotmail/yahoo.com using Oracle9i Utility UTL_SMTP since last 02 days but getting error again and again.
Although i've studied "Asktom forums" about UTL_SMTP but still Its extremly depressing me.
------Here is below procedure and Error Message.----
CREATE OR REPLACE PROCEDURE SEND_MAIL
msg_to varchar2,-------------Will contain Reciptionist E-mail.
msg_subject varchar2,-----Will contain E-mail subject.
msg_text varchar2-----------Will contain E-mail Text body.
IS
c utl_smtp.connection;
rc integer;
msg_from Varchar2(50) := '[email protected]';---------Sender email address.
mailhost Varchar2(30) := 'HP-myoffice-System';------------Dbase reside on host.
BEGIN
c := utl_smtp.open_connection(mailhost, 25);-------SMTP on port 25
utl_smtp.helo(c, mailhost);----------------------------------Handshaking.
utl_smtp.mail(c, msg_from);--------------------------------Sender e-mail.
utl_smtp.rcpt(c, msg_to);------------------------------------Recpti e-mail.
utl_smtp.data(c,'From: Oracle Database' || utl_tcp.crlf ||
'To: ' || msg_to || utl_tcp.crlf ||
'Subject: ' || msg_subject ||
utl_tcp.crlf || msg_text);
utl_smtp.quit(c);
EXCEPTION
WHEN UTL_SMTP.INVALID_OPERATION THEN
dbms_output.put_line(' Invalid Operation in Mail attempt
using UTL_SMTP.');
WHEN UTL_SMTP.TRANSIENT_ERROR THEN
dbms_output.put_line(' Temporary e-mail issue - try again');
WHEN UTL_SMTP.PERMANENT_ERROR THEN
dbms_output.put_line(' Permanent Error Encountered.');
raise_application_error(-20000,
'Failed to send e-mail bcz of Error: ' || sqlerrm);
END;
SQL> /
Procedure created.
SQL>Execute send_mail('[email protected]','Subj:4m utl_smtp','Msg body.');
---------Here is below Error detail.
Permanent Error Encountered.
BEGIN send_mail('[email protected]','Subj:From Oracle9i','MSG body.'); END;
ERROR at line 1:
ORA-20000: Failed to send e-mail bcz of Error: ORA-29279: SMTP permanent error:
550 5.7.1 Unable to relay for [email protected]
ORA-06512: at "SYSTEM.SEND_MAIL", line 30
ORA-06512: at line 1
I would be really greatful and appreciate to any one of you who helpls me in this problem.
Thanks,
H_Innocent.

Hi,
:) Problem Get SOLVED :)
I changed 01 thing and every thing is fine.
msg_from Varchar2(50) := '[email protected]';---------Sender email address.
>mailhost Varchar2(30) := 'HP-myoffice-System';------------Dbase reside on host.
mailhost Varchar2(30) := 'SMTP_IP';--Must mention SMTP SERVR Name/IP.
Now I've e-mailed.
Thanks for all particpants
...

Similar Messages

  • E-mail sending from PL/SQL fails with SMTP error 550 must check for new....

    We have a issue like this. We have a e-mail program (PL/SQL stored procedure which is called from a 10g R2 form) which sends e-mails using UTL_SMTP. It was working but suddenly from day-before-yesterday stopped working. Mail admin says he did not change any mail server paras.
    The DB is in Linux so is the mail server. We finally did a code change. Now the mail goes to SMTP server but the mail does not go out of it (to a gmail address). We did a trace of the SMTP log and found out that it throws *550 [email protected] must check for new mail first* .
    Here is the SMTP server log:
    [192.168.0.6:25]
    Wed 2012-04-25 18:52:46: --> 220 suninsurance.com.fj ESMTP MDaemon 12.5.4; Wed, 25 Apr 2012 18:52:46 +1200
    Wed 2012-04-25 18:52:46: <-- HELO 192.168.0.6
    Wed 2012-04-25 18:52:46: --> 250 suninsurance.com.fj Hello 192.168.0.6, pleased to meet you
    Wed 2012-04-25 18:52:46: <-- MAIL FROM:[email protected]
    Wed 2012-04-25 18:52:46: --> 250 <[email protected]>, Sender ok
    Wed 2012-04-25 18:52:46: <-- RCPT TO:[email protected]
    Wed 2012-04-25 18:52:46: --> 550 [email protected] must check for new mail first
    Wed 2012-04-25 19:02:45: Connection timed out!
    Wed 2012-04-25 19:02:45: SMTP session terminated (Bytes in/out: 96/256)
    Wed 2012-04-25 19:02:46: ----------
    Wed 2012-04-25 19:20:11: Session 17159; child 1What could be the problem here? Any help would be greatly appreciated.

    Finally figured out the problem and fixed it. Now it is working.
    *"must check for new mail first"* means that before sending mail you have to check your mails (i.e. download) your mails first from the mail server, because the normal setting is for SMTP servers is that you can send mail only if you received a mail. So, when you receive a mail (i.e. check mail), your IP is recorded in the SMTP server log. Now if you send a mail, only mails with the IPs which has received any mail will be allowed to send mails outside.
    In order to only a send a mail without receiving any mail first you have to use SMTP authentication.
    I.e. After
    c := utl_smtp.open_connection(p_smtp_host, p_smtp_port);      
    utl_smtp.EHLO(c, p_smtp_host);  You have to give UID/PWD for the SMTP server like this:
    utl_smtp.command( c, 'AUTH LOGIN');
    utl_smtp.command( c, utl_raw.cast_to_varchar2( utl_encode.base64_encode( utl_raw.cast_to_raw( p_un))) );
    utl_smtp.command( c, utl_raw.cast_to_varchar2( utl_encode.base64_encode( utl_raw.cast_to_raw( p_pwd))) );However, when we sent like this we got a another SMTP error:
    554 Message is not RFC compliant; missing "Date" header To solve this do this: Go to Setup -> Default Domain & Servers, Servers, uncheck ...refuse
    messages which are not RFC compliant. That will allow MDaemon to accept  the malformed messages without date headers..Doing this solved the problem. Now we can send mails to outside mail boxes (like Gmail). In Gmail, when we checked the inbox there was no mail. It had gone the Spam folder. This is also important since you have to check the spam folder since Gmail will think it is spam. Once the mail is flagged as "not spam" it will start coming to your inbox.

  • How do i remove an e-mail mailbox from my iPad (leaving one behind)?

    How do I remove an e-mail mailbox from my iPad, as it appears to be causing problems with an nhs.net account?

    You can deactivate an email account in Settings > Mail, Contacts, Calendars > the account > Account. Turn it OFF.

  • How can I migrate my junk-mail settings from one Mac to another?

    I would like to move my junk mail settings from one Mac to another. I found this article (https://kb.siteground.com/how_to_synchronize_the_junk_email_settings_in_mac_mail /), but can't locate the file indicated in the article, so I suspect that the article is out of date (though it's not dated).
    Both machines - MacOS 10.9.5; Mail 7.3.
    Any insights much appreciated!
    Best,
    Doug

    Make your user library visible and see if you can find it.
    Go to Finder and select your user/home folder. With that Finder window as the front window, either select Finder/View/Show View options or go command - J.  When the View options opens, check ’Show Library Folder’. That should make your user library folder visible in your user/home folder.  Select Library.

  • How do I remove an e-mail account from my Nokia e-...

    On my Nokia 5230 I'm using the Nokia e-mail client: http://store.ovi.com/content/8794 . This works fine for me. Yesterday I encountered a little proplem which I cannot resolve so far. I want to remove an e-mail account from my account list and I cannot find a option to do that. Within the menu I can find an option where I can change the settings for the different e-mail accounts, but there is no menu option "remove account". If someone knows a solution please feel free to share it with me.
    The workaround mentiond in this topic: /t5/Messaging-Email-and-Browsing/How-can-i-delete-​my-email-account-from-5230/td-p/685163 does not work sinc it would not find any mailboxes........

    /t5/Messaging-Email-and-Browsing/deleting-yahoo-ac​count/td-p/1112213
    try this was just asked earlier
    If  i have helped at all a click on the white star below would be nice thanks.
    Now using the Lumia 1520

  • 8830..Moving e-mail messages from Inbox to other folder

    On my 8830...When I move e-mail messages from my Inbox to a different folder (under Inbox), they disappear totally from my laptop e-mail rather than mirroring what I did on my BlackBerry.  On the flip side, if I move messages from my Inbox to another folder on my laptop, it does mirror on my BlackBerry.  My e-mail is Outlook 2003, running on my company's Microsoft Exchange Server.  Please help.

    Since you have folders under your Inbox, I can only assume you're on a BES (BlackBerry Enterprise Server) setup receiving your Corporate email.  If that's not the case, I can't figure out how you got folders under your Inbox, and have NO IDEA how you're getting the results you're getting as BIS (BlackBerry Internet Service) email accounts can't have folders!
    You most likely don't have reconciliation enabled for the folders you're moving your email to.
    Go into Messages, hit the [Menu] button and select Options --> Email Settings.  Hit the [Menu] button and select Folder Redirection. 
    You should see your Mailbox at the top with a + to the left of it.  Highlight that line, hit [Menu] --> Expand to display the main folders under your Mailbox.  Your Inbox should appear with a Box next to it either checked or filled in. 
    Highlight Inbox, and again hit [Menu] --> Expand to display the folders under your Inbox.  All the folders under your Inbox, and the boxes are probably unchecked or not "filled in".  Scroll to the folders you want reconciled with your BlackBerry and hit [Space] to check or fill the box next to it.  Use [Menu] --> Expand if there's a + to the left of the box to expand subfolders.
    Once all the folders you want reconciled are checked or filled, hit [Esc] and save.
    Now your email won't dissappear when you move it!  You should also notice in the Messages list that email in folders other than your Inbox have a folder icon rather than an Envelope icon.
    And before you ask...  The BlackBerry does NOT SYNCHRONIZE, it Reconciles.  Email is pushed to the device ONCE, and only changes to the status of messages are transmitted after that.  Moves will only be reflected after you've turned Reconciliation on for a given folder.  BTW - emails you moved that disappeared should have been in your Deleted Items folder.
    Reconciliation rather than Synchronization saves enormously on data transmission ($) as well as Battery life.  Believe me - we have both BlackBerries (Big Wigs only) and Windows Mobile (the rest of the 25,000 peons) devices at my company, and the most common complaint about the Windows devices is battery life, and HUGE costs when the device is overseas!
    Jerry

  • Transfer Mail Rules from Leopard to Mountain Lion

    I have succesfully moved my mail, mailboxes and folders from my old Power PC to my new iMac by moving my Library>Mail folder from one to the other.
    The only thing that didn't carry over were my Mail Rules.
    Is there some other file I'm missing?
    Thanks,
    - Peter

    Mail rules are stored in your user Library/Mail/V2/Mail Data/SyncedRules.plist or at least they are on my computer.
    To make your user library visible:
    Hold down the option key while using the Finder "Go To Folder" command. Enter ~/Library. If you prefer to make your user library permanently visible, use the Terminal command found below. It does work with Mountain Lion.
    http://osxdaily.com/2011/07/22/access-user-library-folder-in-os-x-lion/ 
    You might want to bookmark the command. I had to use it again after I installed 10.8.2. I have also been informed that if you drag the user library to Finder it will remain visible.

  • Transfering mail rules from Lion to Yosemite.

    Help please, how do you transfer mail rules from Apple Mail 5.3 in Lion to 8.0 in Yosemite.  Thanks

    The file in question that you are looking for is SyncedRules.plist in the MailData folder.  I tried re-naming a MessageRules.plist file and it didn't work.  It would be an arduous task, but the best suggestion that I have, other than to re-create your rules, is to use a texteditor like SubEthaEdit to make the format of MessageRules comply with the format of SyncedRules.plist.  I haven't tried it myself, but it might work.  Best of luck!!!

  • Mail-form from dB Masters + reCaptcha - Things wont work the way i want.

    I used a mail-form from dB Masters because someone here gave me the tip.
    And its great! But it uses a simplefied Captcha script.
    I tryd to change the code myself and got to this: http://www.wientjesvoegwerk.nl/PHP/form.php
    If you try to send mail it wont work.....
    form.php
    <!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=utf-8" />
    <title>Email Form</title>
    </head>
    <body>
    <center>
    <form id="form" method="post" action="../formmailer.php" enctype="multipart/form-data">
    <input type="hidden" name="action" value="verify">
    <table cellpadding="4">
    <tr><td  style="text-align: left;" valign=top><font size="2" FACE="Verdana" color="#000000">Uw naam:</font><small><span style="color:#E00000;" title="Required field">*</span></small></td><td align="left">
    <input type="text" name="Naam" value=""/>
    </td></tr>
    <tr><td  style="text-align: left;" valign=top><font size="2" FACE="Verdana" color="#000000">Email:</font><small><span style="color:#E00000;" title="Required field">*</span></small></td><td align="left">
    <input type="text" name="Email" value="" />
    </td></tr>
    <tr><td  style="text-align: left;" valign=top><font size="2" FACE="Verdana" color="#000000">Telefoonnummer:</font><small><span style="color:#E00000;" title="Required field">*</span></small></td><td align="left">
    <input type="text" name="Telefoonnummer" value="" />
    </td></tr>
    <tr><td  style="text-align: left;" valign=top><font size="2" FACE="Verdana" color="#000000">Onderwerp:</font><small><span style="color:#E00000;" title="Required field">*</span></small></td><td align="left">
    <select name="Onderwerp">
        <option value="0">Algemene Informatie</option>
        <option value="1">Offerte</option>
        <option value="2">Overige</option>
        </select>
    </td></tr>
    <tr><td  style="text-align: left;" valign=top><font size="2" FACE="Verdana" color="#000000">Bericht:</font><small><span style="color:#E00000;" title="Required field">*</span></small></td><td align="left">
    <textarea name="Bericht" rows="7" cols="40"></textarea>
    </td></tr>
    <tr><td align=right>CAPTCHA TXT</td>
    <td align="left">
    <form method="post" action="verify.php">
       <?php
         require_once('recaptchalib.php');
         $publickey = "I hide the key on this forum dont know if its ok to show";
         echo recaptcha_get_html($publickey);
       ?>
    </form>
    </td>
    </tr>
    <tr><td></td><td align="left">
    <input type="submit" name="submit" value="Submit" />
    <input type="reset" name="Reset" value="Clear Form" />
    <input type="hidden" name="config" value="0" />
    <input type="hidden" name="nospam" value="" />
    </td></tr>
    </table>
    <div style="height:1px; display: none; visibility: hidden;">
    <input type="text" name="email">
    </div>
    </form>
    </center>
    </body>
    </html>
    formmailer.php
    <?php
    // dB Masters' PHP FormM@iler, Copyright (c) 2007 dB Masters Multimedia
    // http://www.dbmasters.net/
    // FormMailer comes with ABSOLUTELY NO WARRANTY
    // Licensed under the AGPL
    // See license.txt and readme.txt for details
    // General Variables
         $check_referrer="no";
         $referring_domains="www.wientjesvoegwerk.nl";
    // options to use if hidden field "config" has a value of 0
    // recipient info
         $charset[0]="UTF-8";
         $tomail[0]="[email protected]";
         $cc_tomail[0]="";
         $bcc_tomail[0]="";
    // Mail contents config
         $subject[0]="Onderwerp van de Email";
         $reply_to_field[0]="Email";
         $reply_to_name[0]="Naam";
         $required_fields[0]="Naam,Email,Telefoonnummer,Onderwerp,Bericht";
         $required_email_fields[0]="Email";
         $attachment_fields[0]="";
         $return_ip[0]="yes";
         $mail_intro[0]="Er is een bericht gestuurd vanuit Wientjesvoegwerk.nl:";
         $mail_fields[0]="Naam,Email,Telefoonnummer,Onderwerp,Bericht";
         $mail_type[0]="text";
         $mail_priority[0]="1";
         $allow_html[0]="no";
    // Send back to sender config
         $send_copy[0]="yes";
         $copy_format[0]="vert_table";
         $copy_fields[0]="Naam,Onderwerp,Bericht";
         $copy_attachment_fields[0]="";
         $copy_subject[0]="Kopie van uw bericht naar Wientjesvoegwerk.nl";
         $copy_intro[0]="Dank u voor uw bericht!<br />Om veiligheidsredenen is uw email adres en telefoonnummer niet in deze mail te zien.<br /> Het volgende is verstuurd;";
         $copy_from[0]="[email protected]";
         $copy_tomail_field[0]="Email";
    // Result options
         $header[0]="";
         $footer[0]="";
         $error_page[0]="";
         $thanks_page[0]="";
    // Default Error and Success Page Variables
         $error_page_title[0]="Errors:";
         $error_page_text[0]="Ga a.u.b. terug naar de vorige pagina om alle benodigde velden in te vullen.";
         $thanks_page_title[0]="Bericht verzonden.";
         $thanks_page_text[0]="Dank u voor uw bericht!";
    // Antispam Options
         $empty_field[0]="nospam";
         $character_scan[0]="Bericht,Naam,Email,Telefoonnummer,Onderwerp";
         $time_delay[0]="2";
         $captcha_codes[0]="9C2449,EEADC8,77A585,D72838";
         $max_urls[0]="2";
         $max_url_fields[0]="Bericht";
         $flag_spam[0]="";
    // options to use if hidden field "config" has a value of 1
    // recipient info
         $charset[1]="";
         $tomail[1]="";
         $cc_tomail[1]="";
         $bcc_tomail[1]="";
    // Mail contents config
         $subject[1]="";
         $reply_to_field[1]="";
         $reply_to_name[1]="";
         $required_fields[1]="";
         $required_email_fields[1]="";
         $attachment_fields[1]="";
         $return_ip[1]="";
         $mail_intro[1]="";
         $mail_fields[1]="";
         $mail_type[1]="";
         $mail_priority[1]="";
         $allow_html[1]="";
    // Send back to sender config
         $send_copy[1]="";
         $copy_format[1]="";
         $copy_fields[1]="";
         $copy_attachment_fields[1]="";
         $copy_subject[1]="";
         $copy_intro[1]="";
         $copy_from[1]="";
         $copy_tomail_field[1]="";
    // Result options
         $header[1]="";
         $footer[1]="";
         $error_page[1]="";
         $thanks_page[1]="";
    // Default Error and Success Page Variables
         $error_page_title[1]="";
         $error_page_text[1]="";
         $thanks_page_title[1]="";
         $thanks_page_text[1]="";
    // Antispam Options
         $empty_field[1]="bait";
         $character_scan[1]="Naam,Email,Telefoonnummer,Onderwerp,Bericht";
         $time_delay[1]="";
         $captcha_codes[1]="";
         $max_urls[1]="";
         $max_url_fields[1]="";
         $flag_spam[1]="";
    // Don't muck around past this line unless you know what you are doing //
    ob_start();
    $config=$_POST["config"];
    $debug=0;
    $debug_text="";
    // fix for Windows email server security
    ini_set("sendmail_from",$tomail[$config]);
    // email validation regular expression
    $regex = "^[-a-z0-9!#$%&\'*+/=?^_`{|}~]+(\.[-a-z0-9!#$%&\'*+/=?^_`{|}~]+)*@(([a-z0-9]([-a-z0-9]*[a-z0-9]+)?){1,63}\.)+([a-z]([-a-z0-9]*[a-z0-9]+)?){2,63}$";
    $header_injection_regex = "(\r|\n)";
    if($header[$config]!="")
         include($header[$config]);
    if($_POST["submit"] || $_POST["Submit"] || $_POST["submit_x"] || $_POST["Submit_x"])
    // begin global functions //
    // get visitor IP
         function getIP()
              if(getenv(HTTP_X_FORWARDED_FOR))
                   $user_ip=getenv("HTTP_X_FORWARDED_FOR");
              else
                   $user_ip=getenv("REMOTE_ADDR");
              return $user_ip;
    // get value of given key
         function parseArray($key)
              $arrayvalue=$_POST[$key];
              $count=1;
              extract($array_value);
              foreach($array_value as $part_value)
                   if($count > 1){$value.=", ";}
                   $value.=$part_value;
                   $count=$count+1;
              return $value;
    // stripslashes and autolink url's
         function parseValue($value)
              $value=preg_replace("/(http:\/\/+.[^\s]+)/i",'<a href="\\1">\\1</a>', $value);
              return $value;
    // html header if used
         function htmlHeader()
              $htmlHeader="<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\">\n<html>\n<head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=".$charset[$config]."\"></head>\n<body>\n<table cellpadding=\"2\" cellspacing=\"0\" border=\"0\" width=\"600\">\n";
              return $htmlHeader;
    // html footer if used
         function htmlFooter()
              $htmlFooter="</table>\n</body>\n</html>\n";
              return $htmlFooter;
    // build verticle table format
         function buildVertTable($fields, $intro, $to, $send_ip)
              $message=htmlHeader();
              if($intro != "")
                   $message.="<tr>\n<td align=\"left\" valign=\"top\" colspan=\"2\">".$intro."</td>\n</tr>\n";
              $fields_check=preg_split('/,/',$fields);
              $run=sizeof($fields_check);
              for($i=0;$i<$run;$i++)
                   $cur_key=$fields_check[$i];
                   $curvalue=$_POST[$cur_key];
                   if(is_array($cur_value))
                        $curvalue=parseArray($cur_key);
                   $curvalue=parseValue($cur_value);
                   if($allow_html[$config]=="no")
                        $curvalue=htmlspecialchars(nl2br($cur_value));
                   else
                        $curvalue=nl2br($cur_value);
                   $message.="<tr>\n<td align=\"left\" valign=\"top\" style=\"white-space:nowrap;\"><b>".$cur_key."</b></td>\n<td align=\"left\" valign=\"top\" width=\"100%\">".$cur_value."</td>\n</tr>\n";
              if($send_ip=="yes" && $to=="recipient")
                   $user_ip=getIP();
                   $message.="<tr>\n<td align=\"left\" valign=\"top\" style=\"white-space:nowrap;\"><b>Sender IP</b></td>\n<td align=\"left\" valign=\"top\" width=\"100%\">".$user_ip."</td>\n</tr>\n";
              $message.=htmlFooter();
              return $message;
    // build horizontal table format
         function buildHorzTable($fields, $intro, $to, $send_ip)
              $message=htmlHeader();
              $fields_check=preg_split('/,/',$fields);
              $run=sizeof($fields_check);
              if($intro != "")
                   $message.="<tr>\n<td align=\"left\" valign=\"top\" colspan=\"".$run."\">".$intro."</td>\n</tr>\n";
              $message.="<tr>\n";
              for($i=0;$i<$run;$i++)
                   $cur_key=$fields_check[$i];
                   $message.="<td align=\"left\" valign=\"top\" style=\"white-space:nowrap;\"><b>".$cur_key."</b></td>\n";
              if($send_ip=="yes" && $to=="recipient")
                   $message.="<td align=\"left\" valign=\"top\" style=\"white-space:nowrap;\"><b>Sender IP</b></td>\n";
              $message.="</tr>\n";
              $message.="<tr>\n";
              for($i=0;$i<$run;$i++)
                   $cur_key=$fields_check[$i];
                   $curvalue=$_POST[$cur_key];
                   if(is_array($cur_value))
                        $curvalue=parseArray($cur_key);
                   $curvalue=parseValue($cur_value);
                   if($allow_html[$config]=="no")
                        $curvalue=htmlspecialchars(nl2br($cur_value));
                   else
                        $curvalue=nl2br($cur_value);
                   $message.="<td align=\"left\" valign=\"top\">".$cur_value."</td>\n";
              $message.="</tr>\n";
              $message.="<tr>\n";
              if($send_ip=="yes" && $to=="recipient")
                   $user_ip=getIP();
                   $message.="<td align=\"left\" valign=\"top\">".$user_ip."</td>\n";
              $message.="</tr>\n";
              $message.=htmlFooter();
              return $message;
    // build plain text format
         function buildTextTable($fields, $intro, $to, $send_ip)
              $message="";
              if($intro != "")
                   $message.=$intro."\n\n";
              $fields_check=preg_split('/,/',$fields);
              $run=sizeof($fields_check);
              for($i=0;$i<$run;$i++)
                   $cur_key=$fields_check[$i];
                   $curvalue=$_POST[$cur_key];
                   if(is_array($cur_value))
                        $curvalue=parseArray($cur_key);
                   $curvalue=parseValue($cur_value);
                   if($allow_html[$config]=="no")
                        $curvalue=htmlspecialchars($cur_value);
                   else
                        $curvalue=$cur_value;
                   $message.="".$cur_key.": ".$cur_value."\n";
              if($send_ip=="yes" && $to=="recipient")
                   $user_ip=getIP();
                   $message.="Sender IP: ".$user_ip."\n";
              return $message;
    // get the proper build fonction
         function buildTable($format, $fields, $intro, $to, $send_ip)
              if($format=="vert_table")
                   $message=buildVertTable($fields, $intro, $to, $send_ip);
              else if($format=="horz_table")
                   $message=buildHorzTable($fields, $intro, $to, $send_ip);
              else
                   $message=buildTextTable($fields, $intro, $to, $send_ip);
              return $message;
    // referrer checking security option
         function checkReferer()
              if($check_referrer=="yes")
                   $ref_check=preg_split('/,/',$referring_domains);
                   $ref_run=sizeof($ref_check);
                   $referer=$_SERVER['HTTP_REFERER'];
                   $domain_chk="no";
                   for($i=0;$i<$ref_run;$i++)
                        $cur_domain=$ref_check[$i];
                        if(stristr($referer,$cur_domain)){$domain_chk="yes";}
              else
                   $domain_chk="yes";
              return $domain_chk;
    // checking required fields and email fields
         function checkFields($text_fields, $email_fields, $regex)
               $error_message="";
              if($debug==1)
                   $error_message.="<li>text_fields: ".$text_fields."<br />email_fields: ".$email_fields."<br />reply_to_field: ".$reply_to_field."<br />reply_to_name: ".reply_to_name."</li>";
              if($text_fields != "")
                   $req_check=preg_split('/,/',$text_fields);
                   $req_run=sizeof($req_check);
                   for($i=0;$i<$req_run;$i++)
                        $cur_field_name=$req_check[$i];
                        $cur_field=$_POST[$cur_field_name];
                        if($cur_field=="")
                             $error_message.="<li>You are missing the <b>".$req_check[$i]."</b> field</li>\n";
              if($email_fields != "")
                   $email_check=preg_split('/,/',$email_fields);
                   $email_run=sizeof($email_check);
                   for($i=0;$i<$email_run;$i++)
                        $cur_email_name=$email_check[$i];
                        $cur_email=$_POST[$cur_email_name];
                        if($cur_email=="" || !eregi($regex, $cur_email))
                             $error_message.="<li>You are missing the <b>".$email_check[$i]."</b> field or it is not a valid email address.</li>\n";
              return $error_message;
    // attachment function
         function getAttachments($attachment_fields, $message, $content_type, $border)
              $att_message="This is a multi-part message in MIME format.\r\n";
              $att_message.="--{$border}\r\n";
              $att_message.=$content_type."\r\n";
              $att_message.="Content-Transfer-Encoding: 7bit\r\n\r\n";
              $att_message.=$message."\r\n\r\n";
              $att_check=preg_split('/,/',$attachment_fields);
              $att_run=sizeof($att_check);
              for($i=0;$i<$att_run;$i++)
                   $fileatt=$_FILES[$att_check[$i]]['tmp_name'];
                   $fileatt_name=$_FILES[$att_check[$i]]['name'];
                   $fileatt_type=$_FILES[$att_check[$i]]['type'];
                   if (is_uploaded_file($fileatt))
                        $file=fopen($fileatt,'rb');
                        $data=fread($file,filesize($fileatt));
                        fclose($file);
                        $data=chunk_split(base64_encode($data));
                        $att_message.="--{$border}\n";
                        $att_message.="Content-Type: {$fileatt_type}; name=\"{$fileatt_name}\"\r\n";
                        $att_message.="Content-Disposition: attachment; filename=\"{$fileatt_name}\"\r\n";
                        $att_message.="Content-Transfer-Encoding: base64\r\n\r\n".$data."\r\n\r\n";
              $att_message.="--{$border}--\n";
              return $att_message;
    // function to set content type
         function contentType($charset, $format)
              if($format=="vert_table")
                   $content_type="Content-type: text/html; charset=".$charset."\r\n";
              else if($format=="horz_table")
                   $content_type="Content-type: text/html; charset=".$charset."\r\n";
              else
                   $content_type="Content-type: text/plain; charset=".$charset."\r\n";
              return $content_type;
    // end global functions //
    // begin procedural scripting //
         // anti-spam empty field check
         if($_POST[$empty_field[$config]] != "")
              $empty_message = "<li>This submission failed and was flagged as spam.</li>\n";
         // anti-spam character scan check
         if(strlen($character_scan[$config]) > 0)
              $spam_message="";
              $field_check=preg_split('/,/',$character_scan[$config]);
              $field_run=sizeof($field_check);
              for($i=0;$i<$field_run;$i++)
                   $cur_field_name=$field_check[$i];
                   $cur_field=$_POST[$cur_field_name];
                   if(preg_match("/<(.|\n)+?>/", $cur_field) || preg_match("/\[(.|\n)+?\]/", $cur_field))
                        $spam_message.="<li>This message contains disallowed characters.</li>\n";
         // anti-spam time delay check
         if((strlen($time_delay[$config]) > 0 && strlen($_POST["time"]) > 0) || (strlen($time_delay[$config]) > 0 && (strlen($_POST["time"]) == 0 || !$_POST["time"])))
              if((time() - $_POST["time"]) < $time_delay[$config])
                   $time_message = "<li>This has been stopped by the timer, and is likely spam.</li>\n";
         // anti-spam CAPTCHA check
         if(strlen($captcha_codes[$config]) > 0)
              $captcha_check=preg_split('/,/',$captcha_codes[$config]);
              if(strtolower($_POST["captcha_entry"]) != strtolower($captcha_check[$_POST["captcha_code"]]))
                   $captcha_message = "<li>CAPTCHA test did not match.</li>\n";
         // anti-spam max URL check
         if(strlen($max_url_fields[$config]) > 0)
              $max_url_message="";
              $field_check=preg_split('/,/',$max_url_fields[$config]);
              $field_run=sizeof($field_check);
              for($i=0;$i<$field_run;$i++)
                   $cur_field_name=$field_check[$i];
                   $cur_field=$_POST[$cur_field_name];
                   preg_match_all("/http:/", $cur_field, $matches);
                   if(count($matches[0]) > $max_urls[$config])
                        $max_url_message.="<li>This message contains too many URL's.</li>\n";
         // set anti-spam flagging option
         if(strlen($empty_message.$spam_message.$time_message.$captcha_message.$max_url_message) > 0 && strlen($flag_spam[$config]) == 0)
              $set_flag = 2;
         else if(strlen($empty_message.$spam_message.$time_message.$captcha_message.$max_url_message) > 0 && strlen($flag_spam[$config]) > 0)
              $set_flag = 1;
         else
              $set_flag = 0;
         // header injection check
            $security_filter="";
         if(strlen($_POST[$reply_to_field[$config]]) > 0)
              if(eregi($header_injection_regex,$_POST[$reply_to_field[$config]]))
                   $security_filter.="<li>Header injection attempt detected, mail aborted.</li>\n";
              else
                   $reply_to_field_checked=$_POST[$reply_to_field[$config]];
         if(strlen($_POST[$reply_to_name[$config]]) > 0)
              if(eregi($header_injection_regex,$_POST[$reply_to_name[$config]]))
                   $security_filter.="<li>Header injection attempt detected, mail aborted.</li>\n";
              else
                   $reply_to_name_checked=$_POST[$reply_to_name[$config]];
         // check domain referrer and continue
         $domain_chk=checkReferer();
         if($domain_chk=="yes")
              $error_message=checkFields($required_fields[$config], $required_email_fields[$config], $regex);
              if(strlen($error_message) < 1 && strlen($security_filter) < 1 && $set_flag < 2)
                   // build appropriate message format for recipient
                   $content_type=contentType($charset[$config], $mail_type[$config]);
                   $message=buildTable($mail_type[$config], $mail_fields[$config], $mail_intro[$config], "recipient", $return_ip[$config]);
                   // build header data for recipient message
                   //$extra="From: ".$_POST[$reply_to_field[$config]]."\r\n";
                   $extra="From: ".$reply_to_name_checked." <".$reply_to_field_checked.">\r\n";
                   if($cc_tomail[$config]!="")
                        $extra.="Cc: ".$cc_tomail[$config]."\r\n";
                   if($bcc_tomail[$config]!="")
                        $extra.="Bcc: ".$bcc_tomail[$config]."\r\n";
                   if($mail_priority[$config]!="")
                        $extra.="X-Priority: ".$mail_priority[$config]."\r\n";
                   // get attachments if necessary
                   if($attachment_fields[$config]!="")
                        $semi_rand=md5(time());
                        $border="==Multipart_Boundary_x{$semi_rand}x";
                        $extra.="MIME-Version: 1.0\r\n";
                        $extra.="Content-Type: multipart/mixed; boundary=\"{$border}\"";
                        $message=getAttachments($attachment_fields[$config], $message, $content_type, $border);
                   else
                        $extra.="MIME-Version: 1.0\r\n".$content_type;
                   // send recipient email
                   if($debug==1)
                        if($set_flag == 1)
                             $debug_text.="<p><b>Mail would have sent flagged for spam if not in debug mode.</b></p>";
                        else
                             $debug_text.="<p><b>Mail would have sent if not in debug mode.</b></p>";
                   else if($debug==0)
                        if($set_flag == 1)
                             $subject = $flag_spam[$config]." ".$subject[$config];
                        else
                             $subject = $subject[$config];
                        mail("".$tomail[$config]."", "".stripslashes($subject)."", "".stripslashes($message)."", "".$extra."");
                   // autoresponse email if necessary
                   if($send_copy[$config]=="yes")
                        // build appropriate message format for autoresponse
                        $content_type=contentType($charset[$config], $copy_format[$config]);
                        $message=buildTable($copy_format[$config], $copy_fields[$config], $copy_intro[$config], "autoresponder", $return_ip[$config]);
                        // build header data for autoresponse
                        $copy_tomail=$_POST[$copy_tomail_field[$config]];
                        $copy_extra="From: ".$copy_from[$config]."\r\n";
                        // get autoresponse  attachments if necessary
                        if($copy_attachment_fields[$config]!="")
                             $semi_rand=md5(time());
                             $border="==Multipart_Boundary_x{$semi_rand}x";
                             $copy_extra.="MIME-Version: 1.0\r\n";
                             $copy_extra.="Content-Type: multipart/mixed; boundary=\"{$border}\"";
                             $message=getAttachments($copy_attachment_fields[$config], $message, $content_type, $border);
                        else
                             $copy_extra.="MIME-Version: 1.0\r\n".$content_type;
                        // send autoresponse email
                        if($debug==1)
                             if($set_flag == 1)
                                  $debug_text.="<p><b>Autoresponder would have sent flagged for spam if not in debug mode.</b></p>";
                             else
                                  $debug_text.="<p><b>Autoresponder would have sent if not in debug mode.</b></p>";
                        else if($debug==0)
                             $send_copy = 1;
                             if($copy_tomail=="" || !eregi($regex,$copy_tomail))
                                  $send_copy = 0;
                             if($send_copy == 1)
                                  if($set_flag == 1)
                                       $copy_subject = $flag_spam[$config]." ".$copy_subject[$config];
                                  else
                                       $copy_subject = $copy_subject[$config];
                                  mail("$copy_tomail", "".$copy_subject."", "$message", "$copy_extra");
                   // showing thanks pages from a successful submission
                   if($thanks_page[$config]=="")
                        echo "<h3>".$thanks_page_title[$config]."</h3>\n";
                        echo "<p>".$thanks_page_text[$config]."</p>\n";
                        if(strlen($debug_text) > 0)
                             echo "<p><b><i>".$debug_text."</i></b></p>\n";
                   else
                        header("Location: ".$thanks_page[$config]);
              else
                   // entering error page options from missing required fields
                   if($error_page[$config]=="")
                        echo "<h3>".$error_page_title[$config]."</h3>\n";
                        echo "<ul>\n";
                        echo $security_filter.$empty_message.$error_message.$spam_message.$time_message.$captcha_message.$max_url_message;
                        echo "</ul>\n";
                        echo "<p>".$error_page_text[$config]."</p>\n";
                   else
                        header("Location: ".$error_page[$config]);
         else
              echo "<h3>".$error_page_title[$config]."</h3>\n";
              // message if unauthorized domain trigger from referer checking option
              echo "<p>Sorry, mailing request came from an unauthorized domain.</p>\n";
    // end procedural scripting //
    else
         echo "<h3>Error</h3>";
         echo "<p>No form data has been sent to the script</p>\n";
    if($footer[$config]!="")
         include($footer[$config]);
    ob_end_flush();
    ?>
    verify.php
    <?php
    require_once('recaptchalib.php');
    $privatekey = "i hide this on the forum";
    $resp = recaptcha_check_answer ($privatekey,
                                   $_SERVER["REMOTE_ADDR"],
                                   $_POST["recaptcha_challenge_field"],
                                   $_POST["recaptcha_response_field"]);
    if (!$resp->is_valid) {
       // What happens when the CAPTCHA was entered incorrectly
       die ("The reCAPTCHA wasn't entered correctly. Go back and try it again." .
            "(reCAPTCHA said: " . $resp->error . ")");
    } else {
       // Your code here to handle a successful verification
    ?>
    We have a saying in the Netherlands; "Not being abled to see the tree's trough the forest"
    Well i dont see it anymore...
    I managed to get it in the code but it doesnt work.
    I hope someone can help me out!

    @Nancy O.
    Thanks for your support i appreciate it that you helped me out a many times.
    However i have read all of the topics you posted.
    I know in the mail form i can disable the "sort of Captcha". I wanted to disable it and insert reCaptcha instead.
    I will re-make the form because like you said (and i already figured it out myself) ;
    "b) Don't modify forms until you get a very basic form working on your server."
    And youre right, im taking too much work at once.
    @CowboyInAZ
    Im a hobbyist that learns really really fast.
    Before March 23 i never used CSS, Javascript and XHTML. And never combined them all together with PHP. (never ever created a php based file from scratch)
    The reason why i use other persons code is because i learn faster with examples, and because i dont need to reinvent the wheel if someone already invented it. The only thing i do with it is learn the workings, customise it and at last, rewrite the code when i understand it.
    If you look at my current site: http://www.wientjesvoegwerk.nl/
    You will notice that the site is validated by W3C with no errors and warnings.
    I think it was Nancy O. that gave me the link to the validator. Thats how i discovered the service.
    You need to know that in 1 day (from 63 errors and 12 warnings) i removed all errors. And i didnt knew much about it, and why errors happend while the site looks fine.
    So im just curious how things work and thats why i "steal" codes and adjust them to learn myself.
    I also want a education like you spoke of, but im interested in a different media.
    I want to be abled to create my dream project wich involves new ways for game studios to earn money.
    This is just a simple start, im also taking tutorials in C#, C++.

  • How can i have mail attachments from dropbox

    I am using my ipad in my business, and have all my company's file archive on dropbox. I mostly send mails from a webbased crm, and also frim the mail-app in my ipad. But in any situation i only can have mail attachment from myy pictures! How do i set up my ipad so i can pick my attatchments from other places??
    The link sending service from inside dropbox is not good enough for me.

    Hi Oawinje,
    I use the Office2HD app to attach my Dropbox files to email rather than sending a Dropbox link.
    https://itunes.apple.com/us/app/office2-hd/id364361728?mt=8
    You can link Office2HD to your Dropbox account. Then within Office2HD you navigate to your file. Click on the ">" button next to your file listing and select "Email File." This attaches the file (not a link) to a new email message. I haven't found a way to attach multiple files though…
    I don't think you are not going to find the attachment option available within the iOS Mail app due to "sandboxing." IOS apps are all "sandboxed" to prohibit access to their data from other apps. Apple would have to build Dropbox into iOS and have the iOS Mail app tightly integrated with it to allow attachments like you're used to on an OS X computer (the file structure in iOS is very different from OS X). The attachments in iOS Mail must occur from the third party app (like Office2HD) rather than from Mail. I'm not sure why the Dropbox app doesn't offer the option to attach a file like Office2HD does…
    Hope this helps!
    ~Joe

  • Opening mail application from the dock sometimes doesn't open window.

    In Mountain Lion, sometimes when I open Mail on the dock with a single left mouse (or touchpad) click, the Mail application opens, as shown in the menu bar, but a mail window doesn't open. I must then click or double click on it to get it to open a window. No other application in the dock behaves this way. How can I fix this?

    Is there a problem with mail opening from the dock?
    NOPE!  Do you have open at login enabled?  Is Mail listed in Login Items through System Preferences?
    My iMac is automatically up to date with all updates as at 09/01/2014.i
    Your system profile is a complete blank!
    When posting in Apple Communties/Forums/Message Boards.......It would help us to know which iMac model you have, which OS & version you're using, how much RAM, etc. You can have this info displayed on the bottom of every post by completing your system profile and filling in the information asked for.
    CLICKY CLICK---> https://discussions.apple.com/docs/DOC-3602
    CLICKY CLICK-----> Help us to help you on these forums
    ***This will help in providing you with the proper and/or correct solutions.***

  • In Mail, the "From" line shows the wrong name associated with the email id. How do I update it?

    In Mail, the "From" line shows the wrong name associated with my email ID. I've looked over preferences and account information but have not found where I can update it.

    There isn't an email address associated with the contact name who appears as the "from" in Mail. It used to be a shared email address and I already had updated the contact to list only the phone number in case that was causing the problem. 

  • Problems mailing pages from Safari

    At one time I was able to mail web pages or links from Safari with Mountain Lion, but now it has stopped working. The first time I try to mail a page, I'll get a new mail window open (and probably not coincidentally, a second instance of the Mail icon in the dock) but it presents me with a "Loading..." message that lasts until I quit it.
    If I simply close that mail window, any other pages that I try to mail will not even open a new mail window until I force-quit the extra Mail app from the dock.
    Anyone else seen anything like this, or have any ideas about what might be causing it or how to fix it?

    Having two instances of Mail running is definitely not right. If the OS were functioning properly, it should not let more than one instance of Mail run in the same user account.
    Restart your computer while at the same time holding down 'command-R' on the keyboard. When the Utilities window appears, choose 'Install OS X' from the menu. Your user data and apps will not be affected (just the system files get reinstalled), but do take the precaution of making proper backups before you do this.

  • How can I copy my mail folder from my macbook to sync it to my mac air?

    I have a Macbook (black) and a Macair (silver). I use the black one daily, but want to use the silver one when I travel (dead light, etc). I am struggling to figure out how to update the email folder from the black on to the silver. In the past I have used the 'migration' option, but I don't want to migrate everything...only the mail folder. I have spoken to Mac Support several times but their suggestions haven't worked. I do have a Time Capsule that both of them back up to, but as each computer can only see its own back up stuff (pretty technical, I know...sorry), I don't know how to capture the mail folder from the black one and paste it into the silver one. Does anyone know how to do this?

    Type "move itunes library from mac to pc" into the google search bar.

  • TS2776 How can I transfer e-mail contacts from one IPad to another?

    How can I transfer e-mail contacts from one IPad to another?

    Depends on how big the file is.  If itis only a couple of pages, or mostly text, the easiest way would be to e mail it.  If it is a very large file you are going to need wifi.  Take both pads to starbucks, and e mail it from there.  Or if you have wifi, use drop box, for example. 
    Your other choice, avoiding wifi would be a bluetooth type transfer.  There is an app call bluetooth file lite that reads like it will do what you need.   The good news is it is free.  The bad news is that it has terrible ratings.  For grins, i am installing it now on a pad and a phone, and will see if it works.
    With a bluetooth method, you need both devices in  the same place.  If you are trying to send your file across country, bluetooth will not work for you.  you need e mail or drop box type solution, and if the file is big, you will almost certainly need wifi.

Maybe you are looking for

  • Problem in deleting a file.

    I have a text file. I want to delete last few lines of that file. Without using an intermediate file, can I do this in a Java program ? Thanks.

  • Force Yosemite to forget wireless credentials?

    I manage a few dozen MacBooks for a university, which are shared among faculty. They are checked out for a maximum of a week at a time, and some are delivered on a per-class basis as well. I need to be able to force Yosemite to forget the credentials

  • Office Jet 8000 -- Duplex Printing -- back side upside down

    When printing a booklet on my Office Jet 8000 A809, using duplex printing, the back side of each page is upside down.  Operating System is Windows Vista.  I'm sure there is a simple solution, but I can't find it.  HELP.

  • Periodically am redirected to dnsassist page when accessing active sites

    Several times a day when trying to go to active/working websites I am redirected to http://search.dnsassist.verizon.net/assist.php?url= and the following message is displayed: Sorry, We could not find (URL specified) It may be unavailable or may not

  • Using Adobe Presenter or Captivate for video narration

    Case # 181254378 Customer said " Using the latest version of either Adobe Presenter or Captivate on a Windows system with a web cam (or similar video capture device) , we'd like to add a video narration to a PowerPoint presentation that is synchroniz