Jacek's maillinglist tutorial

Post here if you need help with SQL.
User avatar
Helx
Posts: 350
Joined: Thu May 17, 2012 6:45 am
Location: Auckland, New Zealand

Re: Jacek's maillinglist tutorial

Post by Helx »

Ohhhhh

You're going to need to make your email HTML.

[syntax=php]$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";[/syntax]
Add those to your headers (obviously change the name of the variables)
(The '.' before the equals operator 'adds' them together I believe)

Then just add your html content!
Keep in mind that HTML emails often end up in spam.

SOURCE: http://css-tricks.com/sending-nice-html-email-with-php/
Fidbeck
Posts: 147
Joined: Tue Sep 25, 2012 11:40 pm

Re: Jacek's maillinglist tutorial

Post by Fidbeck »

I mean to do something like this
Image
all pretty and stuff
for the unsubscrive link is like this
Image
but for this one I can use the <a href > tags between ' or " i'm not sute which one :)
User avatar
EcazS
Posts: 789
Joined: Fri May 06, 2011 5:29 pm

Re: Jacek's maillinglist tutorial

Post by EcazS »

[syntax=xhtml]
<a href="unsubscribe.php?code=as9d876ya321h">Unsubscribe</a>[/syntax]
I don't get what the problem is...
Fidbeck
Posts: 147
Joined: Tue Sep 25, 2012 11:40 pm

Re: Jacek's maillinglist tutorial

Post by Fidbeck »

It's not a problem lol just saying that I want to make that text into a link.
Fidbeck
Posts: 147
Joined: Tue Sep 25, 2012 11:40 pm

Re: Jacek's maillinglist tutorial

Post by Fidbeck »

Hello again.

I want to add a feature to the mailing list but i'm unsure how to do it.
I want to be able to as soon as the user registers it will receive a welcome message.
User avatar
Helx
Posts: 350
Joined: Thu May 17, 2012 6:45 am
Location: Auckland, New Zealand

Re: Jacek's maillinglist tutorial

Post by Helx »

mail()

More info
Fidbeck
Posts: 147
Joined: Tue Sep 25, 2012 11:40 pm

Re: Jacek's maillinglist tutorial

Post by Fidbeck »

I know I have to use mail function lol but how to check if a new user is registered and send an email.
or the best way is too add that mail in the registration process? something like
if no errors register and send mail
User avatar
Temor
Posts: 1186
Joined: Thu May 05, 2011 8:04 pm

Re: Jacek's maillinglist tutorial

Post by Temor »

well, you could have the mail() function inside your register function.
[syntax=php]function register_user($email,$username,$password){
// Do register type stuff here.

mail($email,'Welcome','Welcome to the site');

return true;
}[/syntax]
Fidbeck
Posts: 147
Joined: Tue Sep 25, 2012 11:40 pm

Re: Jacek's maillinglist tutorial

Post by Fidbeck »

precisely what I was refering.
You do the error checking and if no errors are found you then can send an welcome message to the user.
I was asking if that's the best way to send an welcome message to a newly registered user or the server that you are using has to have that option enabled in order to do that.
User avatar
Temor
Posts: 1186
Joined: Thu May 05, 2011 8:04 pm

Re: Jacek's maillinglist tutorial

Post by Temor »

Well, it is the only way I know of to send an email through PHP, but yes, it does require some tinkering on some servers. Most servers have this enabled by default, but if you're using a free host ( or even some payed hosts ) there might be a chance that they block or limit the email function to prevent spam.
Fidbeck
Posts: 147
Joined: Tue Sep 25, 2012 11:40 pm

Re: Jacek's maillinglist tutorial

Post by Fidbeck »

Guess i'll just do that :) put mail() function in the register form :)

thanks
Post Reply