i had script working little while forgot , forgot how got point able send embed e-mail's godaddy e-mail using smtp. e-mail "f5e66463@p3nlhg1093.shr.prod.phx3.secureserver.net".
this point i'm @ right now:
inv.php
<?php require_once('phpmailer/class.phpmailer.php'); require_once('phpmailer/language/phpmailer.lang-en.php'); date_default_timezone_set('america/detroit'); // php mail version (default) $mail = new phpmailer(true); $mail->issmtp(); // using smtp. $mail->smtpdebug = 1; // enables smtp debug information - should not active on production servers! $mail->host = "relay-hosting.secureserver.net"; // smtp server host. $mail->username = 'username@godaddydomain.com'; $mail->password = 'godaddypassword'; $mail->ishtml(true); $mail->body=" name: $from_name e-mail: $from friends name: $to_name friends e-mail: $to"; $from_name = $_request['your-name']; $from = $_request['your-email']; $to_name = $_request['friends-name']; $to = $_request['friends-email']; $subject = 'mail test @ '.strftime('%t', time()); $message = '<img src="cid:video2">'; $mail->addaddress('testmail@test.te'); $mail->addembeddedimage('video.jpg','video2','video.jpg'); $result = mail($to, $from, $subject, $message, $headers); if(!$mail->send()) { echo 'mailer error: ' . $mail->errorinfo; } else { echo 'message sent!'; } ?>
invite.html
<form action="inv.php" method="post" id="contactform"> <fieldset> <ol> <li> <label for=name>your name</label> <input id="from_name" name="from_name" type="text" placeholder="from_name" required autofocus> </li> <li> <label for=email>your email</label> <input id="your-email" name="your-email" type="your-email" placeholder="example@domain.com" required> </li> <li> <label for=name>friends name</label> <input id="to_name" name="to_name" type="text" placeholder="to_name" required autofocus> </li> <li> <label for=email>friends email</label> <input id="friends-email" name="friends-email" type="friends-email" placeholder="example@domain.com" required> </li> </ol> </fieldset> <fieldset> <button type=submit>submit</button> </fieldset> </form>
the problem here,
addembeddedimage() function requires 2 parameters
1. path of image 2. cid number ie, content-id of attachment, random number.
so, program this
$cid1=date("ymdhis").rand(1000,9999); $cid2=date("ymdhis").rand(1000,9999); $mailobj->addembeddedimage('pic1.jpg',$cid1); $mailobj->addembeddedimage('pic2.jpg',$cid2); ............ ...........
Comments
Post a Comment