Send pdf attachment to emails in mysql database using php -
code:
<?php $servername = "localhost"; $username = "username"; $password = "****"; // create connection $conn = new mysqli($servername, $username, $password); // check connection if ($conn->connect_error) { die("connection failed: " . $conn->connect_error); } $sql = "select email, name myguests"; $result = $conn->query($sql); if ($result->num_rows > 0) { // output data of each row while($row = $result->fetch_assoc()) { $conn->close(); ?> <table width="348" border="0"> <tr> <td width="88">name</td> <td width="98">email</td> <td width="148">select <label> <input type="checkbox" name="checkbox" id="checkbox"> </label> </td> </tr> <tr> <?php {?><td><?php echo $row["name"];?> } </td> <td><?php echo $row["email"];?></td> <td><label> <input type="checkbox" name="checkbox" id="checkbox"> </label></td><?php } else { echo "0 results"; }?> </tr> <tr> <td> </td> <td> </td> <td><label> <input type="submit" name="button" id="button" value="send"> </label></td> </tr> </table> i want send email attached pdf files email users listed in table. have generated pdf files in folder called "slips" has emails filename example every filename bears name of emails in database eg. smith@test.com in email column , pdf file named smith@test.com.pdf
what best php code use such problem.
try send pdf attachment in email,
http://swiftmailer.org/docs/messages.html
Comments
Post a Comment