Jump to content

[SOLVED] include function in php


starvator

Recommended Posts

hello everybody, i am trying to make a newsletter script and i have the form and mysql part working.  Now, i need to make the actual email part.

 

<?php

//define the receiver of the email

$to = 'example@example.com';

//define the subject of the email

$subject = 'Test email';

//define the message to be sent. Each line should be separated with \n

$message = "hello \n how are you?

";

//define the headers we want passed. Note that they are separated with \r\n

$headers = "From: someone@domething.com\r\nReply-To: someone@something.com";

//send the email

$mail_sent = @mail( $to, $subject, $message, $headers );

//if the message is sent successfully print "Mail sent". Otherwise print "Mail failed"

echo $mail_sent ? "Mail sent" : "Mail failed";

?>

 

this is the php code i have so far, which will send the email.

 

I now need to make another form which submits its contents to here:

 

I need a subject box

body box

and it needs to select the email addresses in my mysql table

 

does anyone have anyidea how to do this?

 

do i use the get and post codes?

 

thanks

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.