OK I have been working on a mod for vbulletin. I have it ready but I need one additional item for it. I need to be able to email out a webpage in HTML to users of a specific user group. So my question is what php code do I need to setup an email feature for this? I am by far a pro at php but I am learning as I go.
If you need more info or are willing to help me please let me know what you need and we can discuss this further. If need be I may hire someone to write that part of the code for me.
I need help with mail()
Started by Xhris, Nov 16 2008 09:27 PM
12 replies to this topic
#1
Posted 16 November 2008 - 09:27 PM
|
|
|
#2
Posted 17 November 2008 - 12:30 AM
I haven't tried it myself yet, but as I understand, you don't need an setup to use mail(), it merely uses the internal sendmail program and sends it directly to user's mx-record, mail server.
#3
Posted 18 November 2008 - 01:30 AM
Just use the mail() function, there is no need to install anything. It is a built-in command to PHP and for a manual on it, try the following links;
PHP: mail - Manual
PHP Mail Functions
The first one, is the official documentation on PHP but sometimes it can be hard to understand. So that is why I added w3schools, I learned a lot from that site and they are great!
PHP: mail - Manual
PHP Mail Functions
The first one, is the official documentation on PHP but sometimes it can be hard to understand. So that is why I added w3schools, I learned a lot from that site and they are great!
jQuery Selectors Tutorial - jQuery Striped Table tutorial - jQuery Events - jQuery Validation
Sorry if I don't post as often as I did, I'll try to get here as much as possible! I'm working my bum off to get this scholarship and other stuff!
#4
Posted 18 November 2008 - 10:56 AM
#5
Posted 18 November 2008 - 11:26 AM
Mail() takes several parameters:
The headers include the From name.
PHP mail() Function
mail($to,$subject,$message,$headers,$parameters);
The headers include the From name.
PHP mail() Function
#6
Posted 18 November 2008 - 02:48 PM
Hey thanks for the info everyone has provided. I see this is going to be harder than I thought. I will read through the links above.
Thanks again
Thanks again
#7
Posted 18 November 2008 - 03:36 PM
It's really not that hard. Aside from your content, to send an email only requires one line of php, the one Xav posted.
#8
Posted 18 November 2008 - 03:48 PM
Hi John. First off your avatar is wild man. I like that.
If I use the line Xav posted above how would I get it to pull the web page and email it out as HTML? I know if I view the source of the web page and then copy and paste it into an email script it works fine. So I can't figure out how to pull that code automatically. I sure hope I am making since here.
If I use the line Xav posted above how would I get it to pull the web page and email it out as HTML? I know if I view the source of the web page and then copy and paste it into an email script it works fine. So I can't figure out how to pull that code automatically. I sure hope I am making since here.
#9
Posted 18 November 2008 - 07:11 PM
to send an email as html, you need to do do two things as I know, 1) define in header that it is a html mail (mime type called) 2) make the html as if you did a webpage, and take that code and store it into a variable and put it as the content of the mail.
see example 3 of the page Xav were referring to.
see example 3 of the page Xav were referring to.
#10
Posted 18 November 2008 - 07:49 PM
I will try that. Thanks!
#11
Posted 18 November 2008 - 08:05 PM
So would I do the variable like this?
<?php
$message = "MY HTML CODE";
?>
<?php
$message = "MY HTML CODE";
?>
#12
Posted 18 November 2008 - 09:19 PM
Xhris said:
So would I do the variable like this?
<?php
$message = "MY HTML CODE";
?>
<?php
$message = "MY HTML CODE";
?>
use php-tags when you post.
write [ php ] before your code (with no spaces) and [/php] after.
yes. pretty much that way. and the header. you can copy that example stright off and modify it for your need I suppose.


Sign In
Create Account


Back to top









