/    Sign up×
Community /Pin to ProfileBookmark

php require_once function

Trying to send an email using PHP/SQL to 190 people in a table. The email is an html file.

It throws an error when I do this:

[CODE]<?php
$to = “[email protected]”;
$subject = “$firstname, You are invited to attend this summit”;

$msg = require_once(“http://www.website.ca/email.html”);

mail($to, $subject, $msg, “From: BCPLAN <[email protected]>”)
?>[/CODE]

Error:
Warning: require_once() [function.require-once]: URL file-access is disabled in the server configuration in /home/content/b/c/p/[I]website[/I]/html/page.php on line 20

Warning: require_once([url]http://www.website.com/email.html[/url]) [function.require-once]: failed to open stream: no suitable wrapper could be found in /home/content/b/c/p/website/html/invite.php on line 20

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@NogDogFeb 26.2010 — There is no reason to require it.
[code=php]
$msg = file_get_contents('email.html');
[/code]

Preferably the file should be on the same server, so that you do not need to get by URL but by a local relative or absolute path.
Copy linkTweet thisAlerts:
@realmuffinauthorFeb 26.2010 — Thank you, that solved that problem!

now my problem is that the email that I receive shows up with no formatting and I see all the html tags.. how do I make it so that the receiving email client processes the html tags instead of displaying them as plain text? (I'm guessing it has something to do with headers?)

THANK YOU!
Copy linkTweet thisAlerts:
@NogDogFeb 26.2010 — See Example #4 on the [url=http://www.php.net/manual/en/function.mail.php]mail() manual page[/url].
×

Success!

Help @realmuffin 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 5.28,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

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

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...