Add to Google

Email Sending. - email sending with php.

free web hosting
Open Discussion > CONTRIBUTE > Computers > Programming Languages > PHP Programming

Email Sending. - email sending with php.

khosro_php
this script allow user to send an email for you.
i hope you enjoy wink.gif

CODE
[color="#0000ff"][indent]<?
  
  $top='<html dir="rtl">
  
  <head>
  <meta http-equiv="Content-Language" content="fa">
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  
  <body>
  
  <div align="center">
      <p style="margin-top: 0; margin-bottom: 0">
      <font face="Tahoma" size="1" color="#003366">in the name of god</font></p>
      <p style="margin-top: 0; margin-bottom: 0"><b>
      <font face="Tahoma" size="1" color="#003366">contents of recived form</font></b></p>
      <p style="margin-top: 0; margin-bottom: 0"><font face="Tahoma" size="1">&nbsp;</font></p>
      <table border="0" cellpadding="0" style="border-collapse: collapse" width="500" height="20" bordercolor="#000000" id="table1">
          <tr>
              <td width="161" height="24" style="border-style: solid; border-width: 1px" bgcolor="#F4F4F4" bordercolor="#333333">
              <p align="center" style="margin: 2px 5px"><b>
              <font face="Tahoma" style="font-size: 9pt">name of choce</font></b></td>
              <td height="24" style="border-style: solid; border-width: 1px" bgcolor="#F4F4F4" bordercolor="#333333">
              <p align="center" style="margin: 2px 5px"><b>
              <font face="Tahoma" style="font-size: 9pt">&nbsp;user data entered
              </font></b></td>
          </tr>';
  ##############################
  $body='        <tr>
              <td width="161" style="border-style: solid; border-width: 1px" height="24" bordercolor="#333333">
              <p align="center" style="margin: 2px 5px"><span lang="en-us">
              <font face="Tahoma" style="font-size: 9pt">%field</font></span></td>
              <td style="border-style: solid; border-width: 1px" height="24" bordercolor="#333333">
              <p align="justify" style="margin: 2px 10px; "><span lang="en-us">
              <font face="Tahoma" style="font-size: 9pt">%info</font></span></td>
          </tr>';
  ##############################
  $footer='    </table>
      <p style="margin-top: 0; margin-bottom: 0">&nbsp;</p>
      <p style="margin-top: 0; margin-bottom: 0"><b><font face="Tahoma" size="1">&nbsp;</font></b></div>
  
  <div align="center">
      <table border="0" cellpadding="0" style="border-collapse: collapse" width="500" height="20" bordercolor="#000000" id="table2">
          <tr>
              <td height="25" style="border-style: solid; border-width: 1px" bgcolor="#F2CC84" colspan="2" bordercolor="#333333">
      <p style="margin-top: 0; margin-bottom: 0" align="center"><b>
      <font face="Tahoma" size="1" color="#800000">user information</font></b></p>
              </td>
          </tr>
          <tr>
              <td width="161" height="25" style="border-style: solid; border-width: 1px" bordercolor="#333333">
              <p align="center" style="margin: 2px 5px">
              <font face="Tahoma" style="font-size: 9pt">ip address</font></td>
              <td height="25" style="border-style: solid; border-width: 1px" bordercolor="#333333">
              <p align="center" style="margin: 2px 5px"><span lang="en-us">
              <font face="Tahoma" style="font-size: 9pt">%ip</font></span></td>
          </tr>
          <tr>
              <td width="161" style="border-style: solid; border-width: 1px" height="25" bordercolor="#333333">
              <p align="center" style="margin: 2px 5px">
              <font face="Tahoma" style="font-size: 9pt">your link</font></td>
              <td style="border-style: solid; border-width: 1px" height="25" bordercolor="#333333">
              <p align="center" style="margin: 2px 5px"><span lang="en-us">
              <font face="Tahoma" style="font-size: 9pt">%link</font></span></td>
          </tr>
          </table>
      <p align="center" style="margin: 2px 5px">&nbsp;<p align="center" style="margin: 2px 5px">&nbsp;</div>
  
  <p align="center" dir="ltr" style="margin-top: 2px; margin-bottom: 2px">
  <span lang="en-us"><font face="Verdana" size="1" color="#333333">if you can,t
  Read this , change the encoding to UTF-8</font></span></p>
  <p align="center" style="margin-top: 2px; margin-bottom: 2px">
  <span lang="en-us"><font size="1" face="Verdana">
  <a href="http://khosro.tk"><font color="#800000">Powered By: www.khosro.tk</font></a></font></span></p>
  
  <p align="center">&nbsp;</p>
  
  </body>
  
  </html>';
  ##############################
  if (isset($_POST['email']))
      $email=$_POST['email'];
  else
      $email=$from;
  if (isset($_POST['subject']))
      $subject=$_POST['subject'];
  ##############################
  $header='From: "'.$email.'" <'.$email.">rn"
  .'Reply-To: "'.$email.'" <'.$email.">rn"
  .'To:<'.$to.">rn"
  ."(anti-spam-(anti-spam-(anti-spam-(anti-spam-mime-version:)))) 1.0rn"
  ."(anti-spam-(anti-spam-(anti-spam-(anti-spam-content-type:)))) text/html; charset=utf-8rn"
  ."Content-Transfer-Encoding: 7bitrn";
  ##############################
  $main='';
  foreach($_POST as $k => $v)
      {
      $lists=$body;
      $lists=ereg_replace('%field',$k,$body);
      $lists=ereg_replace('%info',$v,$lists);
      $main .=$lists;
      }
  #############################
  $ip= $_SERVER['REMOTE_ADDR'];
  $link=$_SERVER['HTTP_REFERER'];
  $footer=ereg_replace('%ip',$ip,$footer);
  $footer=ereg_replace('%link',$link,$footer);
  $body=$top.$main.$footer;
  mail($to,$subject,$body, $header);
  header("location: $redirect")
  ?>[/indent][/color]
Notice from jlhaslip:
code tags added

 

 

 


Reply

hitmanblood
Well are you sure that this script works if you send mail on some other server because I found many problems with such things also. I would suggest that anyone who would like to use specialized class called php mailer. It solves all your problems and anyone who use is able to send also attachments by using it.


Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.

Similar Topics

Keywords : email sending email sending php

  1. A Question About Php Mail - A question about how php send mail using which email account in SMTP s (1)
  2. Sending E-mails After News Update? - Coding needed?!? (8)
    I need the following code or the idea how to reach this concept. Let's say, I have a database
    entry which is called "news", where all of the news stories are stored. If this database entry got
    modified, like the new post was added to the web-site by an administrator, the registered users will
    get some kind of email notification automatically, I mean the mails are sent automatically without
    the interaction of someone else. ...
  3. Sending E-mails Based On Intervals? - (7)
    Again, I need your help. I have two database entries, let's say "reg_users" and "news". The
    question is that if somethings was changed in the "news" database, the email letter will be sent
    automatically to all emails which are related to "reg-users" database. So, how can I accomplish this
    point. How can I set this process based on daily, weekly or monthly basis?...
  4. An Interesting Approach To Email Verification... - (6)
    I was thinking just now and I came up with a very interesting solution for email verification.
    It's actually based off of how alot of spammers get your email: Dynamic images. You could have
    a dynamic image display in the email that activates the account when loading it. The only downfall
    to it is if your users are using a an email provider such as Gmail, the images will be blocked, but
    I have a solution for that too. You could have the image say "Congratulations your account has been
    activated". And then below the image in plain text write "If you do not see the...
  5. Php Email Validation - A PHP data validation class with many functions (1)
    I've been reading through my old php book (PHP 4.1) and came across this data validation class.
    It can check a number of things ranging from telephone numbers , credit card number formats, email
    address and some others. I checked out some of the methods although I didnt expect it to work 100%
    because I've found source code errors thoughout the book and CD. I tested out a few of the
    methods to check and some of them did return expected results but some didnt either so the data
    validation class was not perfect and it didnt really bother me. The cool thing I found...
  6. Trouble With Emailer.php - failed sending email error (6)
    Whenever someone registers at my forum, they get this error: Failed sending email :: PHP :: DEBUG
    MODE Line : 234 File : emailer.php however, the account will be sucessfully registered. It is
    weird because i did not change the original emailer.php at all. O__O||| anyone know whats up with
    it?...
  7. Trouble With Phpbb Email - (1)
    Hi guys, I want to know if there is anything you can do for sending confirmation email to your
    users automatically when they have just regeistered, when the host server does not support SMTP
    (Simple Mail Transfer Protocol). ? Thanks alot....
  8. Sending $_get[] Variables To An Application - (3)
    I'm trying to work out if it is possible to send variables to a application on server. E.g
    send the variable of id which is equal to 10 to an application - test.exe?id=10 Any ideas to see if
    this is possible?...
  9. Add Users On Email Program With Php? - (1)
    First of all Marry Christmas, Well so i am in some kind of a problem, i can't find out how to
    add users to my mail service, i have no idea what SMTP/IMAP program the server runs, neither does
    the system administrator. But it should be kinda the same thing for all of them if i am not wrong,
    Anyways i have full access to server so i can do whatever i want to do, i have SSH access too (Root
    access /rolleyes.gif" style="vertical-align:middle" emoid=":rolleyes:" border="0"
    alt="rolleyes.gif" /> )...
  10. Email Header Inject Test - (0)
    So I'm trying to write a script to check if someone is trying to do a header inject using my web
    based email form. The problem is that, regardless of the content, it is being tagged as hijacked.
    The following is the relevant part of my code: CODE $ip=$_POST['ip'];
            $httpref=$_POST['httpref'];
            $httpagent=$_POST['httpagent'];
            $visitor=$_POST['visitor'];
            $visitormail=$_POST['visitormail'];         $s...
  11. Wappymail_v1.50 - wap free mail/ email admin script :-) (15)
    Here is my new wap mail script. You can use it as a free email sending service or an email admin
    form (can set this option in config.php) its extremly simple to install and you will find full
    instructions in the zip file. Please feel free to comment, rate, or update this script :-)
    /tongue.gif" style="vertical-align:middle" emoid=":P" border="0" alt="tongue.gif" /> ...
  12. Email Form - Very Simple (12)
    This is another little script that I devised. It's very simple. As the name suggests, it's
    a script that lets the user send an email via a form. CODE SENDMAIL.PHP echo "<form
    action='form-send.php' method='get'>"; echo "To: <input
    type='text' name='email' size=20>"; echo "Subject: <input
    type='text' name='title' size=20>"; echo "Message: <textarea
    cols=50 rows=25 name='message'></textarea>"; echo "<input typ...
  13. Phpnuke Newsletter Sending Problems - (0)
    i have a problem sending newsletters....when i send them no1 receives it...i tried sending to the
    registered users on my site which im in and i didnt recieve it in my mail...i dont know why this is
    happening...it says the newsletter is sent...but we get nothing in our mail... heres the code
    QUOTE /************************************************************************/ /* PHP-NUKE:
    Web Portal System */ /* ===========================
    */ /* ...
  14. Yet Another Problem With A Form Script - Maybe I should just use email? lol (6)
    Okay, here is what I got. I know, three topics on form scripts, but hey, I am learning. I used a
    generator, and then put it on, but it is giving me a santax (is that how you spell it) on line 13
    with an unexpected = sign. I recited taht the best I could. Anyway, so I need some help. The form
    is located in http://inneed.mxweb.co.uk/askandanswer.html The script behind the whole works, I
    named, aaform.php. Moving right along here, I got this error, so here is the code that I called
    aaform.php, you know the one that works the whole thing: CODE <?php // Webs...
  15. Email Server Help Please - I need noob detailed help on setting up a email server on windows XP (0)
    Hello I would like to say thank you for any help you might give me. I'm new to Apache / PHP and
    MySQL I have all them up and running propertly I think. I want to make a PHP online game and I need
    to set up an email server so I can have and authincation system. When the player creates an account
    I want the computer to email the player a link the have to click on to make there account active.
    I have a Comcast 8mbits broadband connection My server is running at http://192.168.1.105 My
    PHPinfo file is http://192.168.1.105/phpinfo.php My FormMail File http://192...
  16. Sending Messeges Over A Website. - (3)
    i want to learn how members of a website can send messeges to each other using php since im learning
    it. okay i can write in more detail..that for example if users can register on a website , suppose
    there are some users on the website , and now i want to learn how they can send messeges to each
    other.suppose each user has a unique ID ... and for example if some one has send the messege to
    other member of website , then he can know that he has recieved a new messege..something like inbox
    on the website where all of his messeges can be stored...lets say same way like on t...
  17. Sending Attachments Using Email Function In Php - (2)
    I'm trying to send an attachment using the mail Php function. It gets caught by the email
    server with an error. It seems to have a problem with the separator or who knows what. The server
    says something like "invalid separator on mime type." The code is: Code: CODE  // subject
    $subject  = "Hello There "; $mime_boundary =
    "<<<--==-->>>";        // headers        $headers  =
    "From: " . 'Tom' . " <" . 'texample@aol.com' .
    ">\r\n"; �...
  18. How Handle Sending Back Multiple Checkboxes - (1)
    I know how to send back the check-boxes, so that's not the issue. I have a form that contains a
    group of 5 check-boxes. The user could select none, one, all, or any combination in between.
    I'm working on form validation right now and am doing most of it server side. The validation is
    set so that if the user has to go back all their data is retained. I'm using case statements,
    which work wonderfully, but in this circumstance I don't know what would be the best method that
    allows for a multitude of combinations. I think there is a possibility of somethi...
  19. Protecting Web Email Forms - (3)
    i have a web form on my site which can be filled in with a customers email, name and question or
    comment. when the form is submitted an email is sent to an address i setup with all the info.
    recently i've been getting alot of spam/junk coming from the web form. for the most part, they
    usually come pretty close together, which makes it seem like just one spammer (at least at a time).
    also i'm talking like 5-10 messages at a time. i'm wondering if people have any
    suggestions how to protect these types of web forms from spammers. any ideas/help is appreciate...
  20. Form To Pdf, With Email? - Wanting to Submitt Data to PDF (3)
    Hi all, This sounds like a good place to ask this, I have a form Click Here to View that when
    submitted will put the values into the PDF Here Is there a way in which to have the filled in
    form both viewed to the user? and also have it emailed to me as an attachment. Any code or help
    would be good... I get basics, but this stuff is hard to get to work and i can't get it to....
  21. Email Code - (3)
    CODE if($submit) //If submit is pressed { mail("youremailaddress@whatever.com",
    "$subject", "$email", "$comments"); } else {?> '> E-Mail: Subject:
    Comments: ...



Looking for email, sending, email, sending, php,

*RANDOM STUFF*





*SIMILAR VIDEOS*
Searching Video's for email, sending, email, sending, php,

*MORE FROM TRAP17.COM*
advertisement



Email Sending. - email sending with php.



 

 

 

 

ADD REPLY / Got an Opinion! a humble request :-) RAPID SEARCH! Free Hosting [X]
Express your Opinions, Thoughts or Contribute your information that might help someone here.
Ask your Doubts & Queries to get answers.. "Together, We enlight each other!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE