Jump to content
xisto Community
rigueira

Php Functions To Send Mail

Recommended Posts

The mail function provided by default in PHP is more than enough to fit all the needs of a programmer concerning this. In order to get other mail functions, you would have to install some PHP mail modules into your server or when compiling PHP from source.

Share this post


Link to post
Share on other sites

I believe Xisto servers allow mail() function, I'm not sure, as I didn't have the need to use it...And since you do need to install additional libraries for PHP, and recompile, you won't be able to do that, until you run your own server, because most hosts run only the default PHP binaries, with maybe few additional functionalities included...mail() function is more than enough to send an email automaticaly, from your script... Move your hosting to Xisto, and you'll be able to use mail() function...

Share this post


Link to post
Share on other sites

I believe Xisto servers allow mail() function, I'm not sure, as I didn't have the need to use it...

I've tried it and the mail() function works great. I think it's all anyone would need and like Galahad said, you wouldn't be able to install PHP addons unless you were running your own web server in which case you could just enable the mail function.

Share this post


Link to post
Share on other sites

Mail() does indeed work at T17 :)

The reason many hosts dont allow it, especially the free ones, is it is too easy to abuse. you can easily use the mail function to send lots of spam, hundreds a minute so most free hosts dont allow it.

As for alternatives i dont think there are any in PHP as there is no real need for an alternative!

@sheetal: Have you tried setting the HTML into a variable like this:

$html = "<HTML> My content here</HTML>";mail("enail@email.com", "subject", $html);

HTML sends fine in PHP though ive never tried sending Iframes. The only reason i can see for this not working is that the email provider, eg hotmail, has disabled the use of Iframes. You can test this by setting up your own mail server and using that for testing, but its a little complex....

My gut feeling is that the email provider has disabled the use of frames and Iframes, and to be fair i dont see much use for them in an email

Share this post


Link to post
Share on other sites

Plz help me in using iframe tag

My gut feeling is that the email provider has disabled the use of frames and Iframes, and to be fair i dont see much use for them in an email

No webmail service or any mail client supports the iframe tag. I have never seen an iFrame in an email, and I'm glad that I haven't. The ability to insert iFrames into emails can lead to major security risks for the recipients email account, and it also completely defeats the point of an email. An email isn't an html page. It is a message, and yes I know you are able to insert basic HTML into emails such as images and tables, but that's just to make the email more stylish. You should technically never be able to add frames, javascript, or other advanced html into emails. If you are familiar with making dynamic images rendered by a server you can use that if there is some dynamic content you wish to put in an email, or you could place a link to the page you wanted to frame in your email, but other than that I can think of no other solution to your problem.

Share this post


Link to post
Share on other sites

Back to the original post... is there a javascript send mail function? Or a way to do it? Im sure that i wanted to send an email from a page but didnt know PHP so i got a JS one but it gave an alert to the user asking for permission to send it, and so i learned PHP and here i am today able to do so much from just the desire to send an email!

Share this post


Link to post
Share on other sites

is there a javascript send mail function?

Hmm, well I know there is a way of using mailto to open the user's default email client and filling the fields out for them automatically, and there might be a javascript equivalent to that, however the user must still click on the send button manually to be able to send the message. If javascript alone could send messages it would need to use an email from the user's computer, because javascript alone couldn't contact a server and command it to do something without some server side language sitting there accepting javascript's pleas. So unless javascript is hiding some virtual server in its pocket, I don't think javascript alone could do anything like this.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | 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.