Skip to main content

Localhost And Webhosting Se Attachment Kaise Send Kare –By Using Phpmailer


send attachment with phpmailer


Localhost And Webhosting Se Attachment Kaise Send Kare –By Using Phpmailer


Hello Friends Ajj Me Apko Btaunga Ki Kis Parkar Ham Php Mailer Ka Use Karke User Ki Email Id Par Attachment Send Kar Sakte Hai.Apne Kai Website Par Ye Feature Dekha Hoga Ki Wanha Ek Textbox Ka Option Hota Hai Jb Ham Textbox Me Apne Email Id Enter Karke Submit Karte Hai T Us Website Ke Dwara Automatic He Download Link,Attachment,Pdf File Hmare Email Id Par A Jati Hai.Ye Ek Bhut Acha Feature Hai .Aap Be Iska Use Apne Website Me Kar Sakte Ho.Hm Mail Ko 2 Type Se Send Kar Sakte Hai Ek To Mail Function And Dusra Phpmailer ,Ajj Me Apko Phpmailer Ke Bare Me Btaunga Kiunki Iska Use Karke Aap Localhost Se Be Attachment And Email Send Kar Sakte Ho.


Demo Link

Send Email With Phpmailer


Sabse Pehle app Github se PHPMailr Library Download Kar lijiye


Download PHPMailer Library


Steps for send mail with attachment(phpmailer)

1-ek index.php name ki file bana lijiye.

Index.php





<?php

  if(isset($_REQUEST['send']))

      {



$email=$_POST['email'] ;



require 'PHPMailer-master/PHPMailerAutoload.php';



$mail = new PHPMailer();



  //Enable SMTP debugging.

  $mail->SMTPDebug = 0;

  //Set PHPMailer to use SMTP.

  $mail->isSMTP();

  //Set SMTP host name

  $mail->Host = "smtp.gmail.com";

  $mail->SMTPOptions = array(

                    'ssl' => array(

                        'verify_peer' => false,

                        'verify_peer_name' => false,

                        'allow_self_signed' => true

                    )

                );

  //Set this to true if SMTP host requires authentication to send email

  $mail->SMTPAuth = TRUE;

  //Provide username and password

  $mail->Username = Yourgmailidhere";//enter your gmail id here

  $mail->Password = "yourgmailpasswordhere";/enter your gmail password here

  //If SMTP requires TLS encryption then set it

  $mail->SMTPSecure = "false";

  $mail->Port = 587;

  //Set TCP port to connect to



  $mail->From = "kashyapbhupender122@gmail.com";

  $mail->FromName = "jignesh";



  $mail->addAddress($_POST["email"]);



  $mail->isHTML(true);

$mail->addAttachment('sonu.txt'); //set new name





  $mail->Subject = "test mail";

  $mail->Body = "this is your attachment";

  $mail->AltBody = "This is the plain text version of the email content";

  if(!$mail->send())

  {

   echo "Mailer Error: " . $mail->ErrorInfo;

  }

  else

  {

   echo "<h1>Message has been sent successfully</h1>";

  }



  }

  ?>







  <html>

<head>

      <title>send mail using phpmailer in php</title>

</head>

<body>

<h1>Send attachment To Email Id </h1>

  

      <form action="" method="POST">



      <label for="email">Email:</label>

      <h1><input type="email"  name="email"></h1>

      </div>



      <button type="submit" name="send" >Send Mail</button>

      </form>

      </div>

      

</body>

</html>



Is parkar aap easily phpmailer ka use karke attachement send kar sakte hai





Multiple attachement Kaise Send Kare/multiple files ek sath kaise Bheje


$mail->addAttachment('sonu.txt'); //set new name

$mail->addAttachment('kunal.txt'); //set new name

$mail->addAttachment('rahul.txt'); //set new name

$mail->addAttachment('gajabwap.txt'); //set new name


Janha Apne Ek Attachment Add Ki The Wanha Aap Jitney Be Attachemtn Bhejna Chahte Hai Sabko Add Kar Sakte Ho Inka Procedure Same Hai.

Is Parkar Aap Easily Multiple Files Send Kar Sakte Ho.

Note-Jin Files Ko Aap Send Karna Chahte Ho Unhe Us Folder Me Rakhe Janha Apki Ye Index.Php File Ho .
Thank You

Team Gajabwap Web In Hindi


Comments

  1. nice information bro please php curl par post likhe

    ReplyDelete
    Replies
    1. Thanks bro comment karne ke liye Me jaldi He curl ke upper ek tutorials bnane wala hu aap Blog par bane rahe

      Delete

Post a Comment

Popular posts from this blog

How to Download Vimeo Thumbnail With PHP

Vimeo Thumbnail Downloader Tool – Vimeo Video Ka Thumbnail Download Karein Aaj ke is tutorial mein hum Vimeo Thumbnail Downloader Tool ke baare mein jaanenge. Is tool ki help se hum Vimeo video URL se us video ki thumbnail image obtain kar sakte hain. Agar aap PHP, Web Development, HTML, CSS aur Online Tools banana seekh rahe hain, to ye ek useful PHP project example hai. Vimeo Thumbnail Downloader Kya Hai? Vimeo Thumbnail Downloader ek simple tool hai jisme user Vimeo video ka URL enter karta hai. Tool Vimeo video ID ko identify karta hai aur available thumbnail image ko display karta hai. Example Vimeo URL: https://vimeo.com/389063954 Is URL mein: 389063954 Vimeo video ID hai. Vimeo Thumbnail Downloader Kaise Work Karta Hai? Is PHP script mein mainly do functions use kiye gaye hain: 1. getVimeoId() Ye function Vimeo URL se video ID find karta hai. 2. getVimeoThumb() Ye function Vimeo video ID ke basis par thumbnail information retrieve karta hai aur available thumbnail...

How To Create Contact Form With Validation-Php & Html

How To Create Contact Form - Hello Friends Ajj Me Apko Btaunga   Ki Kis Prakar   Ham Apni Website Ke Liye Contact Form Bnana Sakta Hai.( By Using   Php Contact Form With Validation Script ) Contact Form Hmare Website Ke Liye Bhut He Jrruri Hota Hai.Contact Form Ke Help Se He User Apna Message Website Owner(Admin) Ko Bhej Sakte Hai. Ajj Me Apko Btane Wala Hu Ki Kis Parkar Ham Contact Form Banakar Apne Website Me Add Kar Sakte Hai Or Apni Website Ke Liye Contact Form Bana Sakte Hai Is Contact Form Me   Ham Php Mail Function() Ka Use Karege . Ab Jab Be Koi User Contact Form Me Apni Information ,Message Details Fill Karke Submit Karega To Uski Sare Information Website Admin Ke Email Id Par A Jaiyegi Jo Be Admin Dwara   Niche Diye Gye Code Me Setup Ki Hogi. Used Language- ·          HTML ·          Jquery ·          Php ...

How To Send Sms From Website Using Php-Textlocal SMS

Hello Friends Ajj Me Apko Btaunga Ki Kis Prakar Aap Apni Website Me Free Sms Send Ka Option Integrate Kar Sakte Ho. Bulk sms in India-Best company Iske Liye Apko Sabse Pehle   Https://Www.Textlocal.In/Signup Par Signup Karke Account Create Karna Hai.Ye Ek Achi bulk sms provider company hai ·          Account Create Hone Ke Bad Aap Apna Username And Password Enter Karke Apne Dashboard Me Login Ho Jaiye( textlocal login) ·          Yanha Apko Text Local Company Dwara 10 Meassge Free Testing Ke Liye Diye Jayege ·          Aap Sms Plan Buy Kar Sakte Ho Is Company Dwara Bhut He Kam Prize Me Sms Pakage,plan provide  Kiye Jate Hai Textlocal Price Plans –  index.php <?php if(isset($_POST['code']) &&  isset($_POST['mobile'])){ // Authorisation details. $username = "enter your textlocal account email id here"; $hash = "...