/    Sign up×
Community /Pin to ProfileBookmark

html email sent based on web page loading

I have a web page…when that page loads, i want an HTML page to be sent via email to their email address. but I don’t want it to be an attachment, I need it to be part of the body.

thanks in advance!

to post a comment
PHP

7 Comments(s)

Copy linkTweet thisAlerts:
@PittimannAug 03.2004 — Hi!

Fortunately, you cannot spam people who's email address you don't seem to have.

Did you believe that a scripting language is able to catch anybody's addy? Or are you talking about a member system which you want to loose all members within a very short time?

Cheers - Pit
Copy linkTweet thisAlerts:
@mraspillerauthorAug 03.2004 — Pittimann,

thanks for the reply, sorry, I should have given more details...

i will have their email address...here is exactly what will be happening...

a person registers at my site. then they get a thank you page. when that thank you page loads, i want an html page to be emailed to them. that html page is a confirmation page that also gives them login information, etc.and it has to be in the body of the email, it can't be an attachment.

but, the email MUST be sent based on the loading of the thankyou page. It can't be sent based on clicking the submit button. it's hard to explain...

thanks again.
Copy linkTweet thisAlerts:
@PittimannAug 03.2004 — Hi!

I understand.but I don't want it to be an attachment, I need it to be part of the body.[/QUOTE]You might have a problem with that part. Many users cannot or do not want to (a part of them because they set their mailprogram to html-mails=no) receive mails in html format. How would you like to deal with these people?

Cheers - Pit
Copy linkTweet thisAlerts:
@mraspillerauthorAug 03.2004 — i would put an HTML comment right at the top of the page that said:

<! --

IF YOU CAN'T VIEW THIS PAGE, PLEASE GO TO

HTTP://WWW.THISPAGE.COM

-->

the page being emailed will also be hosted for just that posibility...
Copy linkTweet thisAlerts:
@AdamGundryAug 03.2004 — The most effective way to do this is to use MIME (Multipurpose Internet Mail Extensions) - you can send both HTML and text versions of a message in a single email, and the recipient's mail program should choose the correct one automatically.

Check out [url=http://www.zend.com/zend/spotlight/sendmimeemailpart1.php]this tutorial[/url] (quite long) for more details. You may wish to skip ahead to [url=http://www.zend.com/codex.php?id=103&single=1]this class[/url].

Adam
Copy linkTweet thisAlerts:
@mraspillerauthorAug 03.2004 — thanks for the tutorial...it's a bit over my head. I guess this is not going to be as easy as I thought. ?
Copy linkTweet thisAlerts:
@squallflightAug 05.2004 — I remember I did a little side project once which has a simular problem with email, but this should solve the problem

[code=php]
//basic parameters
$to = 'emailaddress';
$subject = 'subject';
$msgbody = 'Your message';

//extra parameteres
$xheaders = 'From: [email][email protected][/email]n
X-Mailer: PHP/'.phpversion().'n
MIME-Version: 1.0n
Content-Type: text/htmln
charset="iso-8859-1n"';

//send email
mail($to, $subject, $msgbody, $xheaders);
[/code]


the n is very important in the headers.

X-mailer is not needed but is useful for tracing the email and some mail providers don't like emails without it.

The Content-Type command does it all.

You should also ask your members if they can recive HTML email as some won't.
×

Success!

Help @mraspiller spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...