Send image
Posted: Tue Feb 13, 2007 3:28 pm
feyd | Please use
Could anybody help me here?
Thanx in advanced,
ayoksus
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hi there,
I'm a php newbie and have very little knowledge about php, but I like to learn more about it. I help some friends to build in their website for my excersice. Now I have a question about sending an image to email with php.
I found a tutorial about newsletter, and made a simple newsletter based on the tutorial. I just fill in the list of emails into a .txt database, and fill in a form to send the news. It works fine. But I'd like to have an image on the top of the news. I've tried to figure it out, but no result. I can't find any tutorial about it.
Perhaps anybody can help me? This is the send.php file, where the news will be sent.Code: Select all
<?php
include "config.php";
include "header.inc";
if(!($sendmail)){
?>
<form method="POST" action="<?php echo($PHP_SELF); ?>">
<h3>News </h3>
<p>Select Mailing List:<br>
<select size="1" name="list_choice">
<option selected>emails.txt</option>
</select></p>
<p>Title:<br>
<input type="text" name="subject_choice" size="50"></p>
<p>Message:<br>
<textarea rows="6" name="message_choice" cols="42"></textarea></p>
<p><input type="submit" value="Send Mail" name="sendmail"><input type="reset" value="Reset" name="B2"></p>
</form>
</UL>
<?php
}
//from config.php
$header = "From: $from_mail; \n";
if ($sendmail == "Send Mail"){
print ("<H3>Sending news to emails...</H3><P>");
$file_handle = fopen($list_choice, "r") or die("Couldn't open mailing list..");
while (!feof($file_handle)) {
set_time_limit(0);
$address = fgets($file_handle, 1024);
mail("$address", stripslashes($subject_choice),
stripslashes($message_choice), $header);
print ("Mail Sent To: $address<br>\n");
}
print ("<H3>Done! The news is sent. Klik <A HREF='view.php'>Click here</A> to see the emails.</H3><BR>");
}
include "footer.inc";
?>Thanx in advanced,
ayoksus
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]