Reply
Add image to newsletter
Old 10-12-2009, 10:26 PM Add image to newsletter
PC Catastrophe's Avatar
Super Talker

Latest Blog Post:
Google Chrome Release
Posts: 120
Name: Brandy
Location: Indiana
Trades: 0
I have read a billion different tutorials on adding html and attachments to a newsletter, but can't seem to find what I am looking for, so can someone help?

I have a form in which the person can put in the subject and newsletter text, when they hit send it goes to the php page. I just want to make it so their logo will be in the email regardless of the message. This is the php:

PHP Code:
 <?php     
      
if (($_POST[subject] == "") || ($_POST[newsletter] == "")) {
    
header ("Location: email.html");
    exit;
    } else {
        
$db_name "db";
        
$table_name "table";
        
$connection = @mysql_connect("url""fname""password")
        or die(
mysql_error());
    
        
$db = @mysql_select_db($db_name$connection) or die(mysql_error());
        
        
$sql "select email from $table_name";
        
        
$result = @mysql_query($sql,$connection) or die(mysql_error());
  
        
        
$headers "From:  <url>\n";
        
        while (
$row mysql_fetch_array($result)) {
            
$email $row['email'];
            
            
mail("$email"stripslashes($_POST[subject]),
                
stripslashes($_POST[newsletter]), $headers);
            
        echo 
" $email <br />";
        
        
        
        
    }
}
?>
__________________
ContractCoomer.com
PC Catastrophe is offline
Reply With Quote
View Public Profile Visit PC Catastrophe's homepage!
 
 
When You Register, These Ads Go Away!
Old 10-13-2009, 07:19 AM Re: Add image to newsletter
Ultra Talker

Posts: 334
Trades: 0
I don't think it's related to MySQL query or PHP code. Is your email code (which gets extracted from database) correct? Are other HTML elements displayed?
__________________
Daniel, Helpdesk Leader
Hosting24.com Web Hosting - First class web hosting services.
Reseller Hosting - Provide unlimited disk space and bandwidth!
Hosting24 is offline
Reply With Quote
View Public Profile
 
Old 10-13-2009, 01:56 PM Re: Add image to newsletter
PC Catastrophe's Avatar
Super Talker

Latest Blog Post:
Google Chrome Release
Posts: 120
Name: Brandy
Location: Indiana
Trades: 0
I fiddled with it some too and couldn't get an image to send with it. Do you have an idea? I am notorious for missing the obvious and am very new to php.

HTML Code:
  <form method="POST" action="email.php">
    
            <p><span class="text_bold">Subject:</span><br />
         <input type="text" name="subject" size=100></p>
            <br />

            <p><span class="text_bold">Email:</span><br />
            <textarea name="newsletter" cols=100 rows=10 wrap=virtual>
            
            </textarea>


         <input type="submit" name="submit" value="Send"></p>
    
      </form>
       
__________________
ContractCoomer.com
PC Catastrophe is offline
Reply With Quote
View Public Profile Visit PC Catastrophe's homepage!
 
Old 10-13-2009, 02:20 PM Re: Add image to newsletter
chrishirst's Avatar
Super Moderator

Posts: 26,496
Location: Blackpool. UK
Trades: 0
Maybe if we saw the code that actually created the newsletter itself prior to sending, rather than the code that allows the user to type something we would be of more help!!
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Growing old is mandatory - Growing up is optional
Code Samples | Crowded Nightclub? | Bits & Bobs
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 10-13-2009, 03:42 PM Re: Add image to newsletter
PC Catastrophe's Avatar
Super Talker

Latest Blog Post:
Google Chrome Release
Posts: 120
Name: Brandy
Location: Indiana
Trades: 0
Let me try to re-phase this so it is easier to understand I guess. Once the user types in the subject and newsletter and hits send...it goes to the php page retrieves all of the contacts in the database and sends out the newsletter to all of the contacts. All I am asking is how I can make one image, the user's logo, be sent regardless of what they decide to type in the newsletter. I understand how to make a newsletter with html and images and send it out myself. I am not wanting to create the newsletter, but rather have a page the user can type in a different subject and newsletter, but that will send their logo attached everytime without them having to do anything other than type and hit send
__________________
ContractCoomer.com
PC Catastrophe is offline
Reply With Quote
View Public Profile Visit PC Catastrophe's homepage!
 
Old 10-13-2009, 04:38 PM Re: Add image to newsletter
chrishirst's Avatar
Super Moderator

Posts: 26,496
Location: Blackpool. UK
Trades: 0
I understand what you are doing I have done the same thing myself (in ASP)

You simply code the image into the HTML template that the newsletter is created from. The text that the user types in is inserted to the template before sending it out.

My app had several templates with preset images headings and logos for a company that had several different divisions and each division used the same list but used different formats for their logos and headings. So a radio button selected which template was used and the user entered text was added to the page as it got sent.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Growing old is mandatory - Growing up is optional
Code Samples | Crowded Nightclub? | Bits & Bobs
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 10-14-2009, 09:57 AM Re: Add image to newsletter
PC Catastrophe's Avatar
Super Talker

Latest Blog Post:
Google Chrome Release
Posts: 120
Name: Brandy
Location: Indiana
Trades: 0
Something like that would actually be even better. I am taking my final class to receive a degree with a major in web design. The class is a work experience class in which I found a client to create a website for and basically just have to make him happy, put in a certain amount of hours, write a few papers and participate in the class. I wanted to build on some of the things I learned in my courses over the last couple of years. Do you know of a decent tutorial I can have a look at involving this?
__________________
ContractCoomer.com
PC Catastrophe is offline
Reply With Quote
View Public Profile Visit PC Catastrophe's homepage!
 
Old 10-14-2009, 01:19 PM Re: Add image to newsletter
chrishirst's Avatar
Super Moderator

Posts: 26,496
Location: Blackpool. UK
Trades: 0
It needs more than design knowledge, you also need the server side programming to make it actually work.

As the server can run PHP, take a look at PHPList
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Growing old is mandatory - Growing up is optional
Code Samples | Crowded Nightclub? | Bits & Bobs
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to Add image to newsletter
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.11085 seconds with 13 queries