chobo2 Posted April 7, 2007 Share Posted April 7, 2007 Hi I need your guys help. First off let me just say I am a php noob(less then a week using php) so please assume I know nothing because I don't I have made a mailer so when a user creates an account it emails them their username and password. Here is my code: * This stores the incoming email address from the form and puts it into another variable */ $to = $email; /* this is where the subject header of the email will go */ $subject = "Welcome to ----!"; /* this is where the body of the email will go. In the message it uses the users name by taking it from the form. It also does this same thing for username and password */ $body =<<< emailbody PLEASE DO NOT RESPOND TO THIS EMAIL Dear $fName $lName, This email confirms that you have sucessfuly created an acount at ----- Here is your account information: username: $user password: $pass Please keep this incase you forget your username or password. Thank you, The ---- staff emailbody; /* this is where your email address goes */ $headers = "From: [email protected]\n"; /* this tells the user if it they will get a email or if it failed to send the email */ if(mail($to,$subject,$body,$headers)) { echo "An e-mail was sent to $to with the subject: $subject"; echo '<br />'; } else { echo "There was a problem sending the mail. Check your code and make sure that the e-mail address $to is valid \n"; echo '<br />'; So I finally got it to work on my computer since I did not know I had to go into the php.ini file and setup a smtp address from my isp. But now I need to upload it to a php web hosting site(a free one) but the one I use does not allow this mail() function. I get a warning bitch about it: Warning: mail() [function.mail]: Safety Restriction in effect. The mail() command is not allowed, contact the admin. in /www/110mb.com/b/c/i/t/2/_/_/_/bcit2/htdocs/login2/Login/autoSendEmail.php on line 46 There was a problem sending the mail. Check your code and make sure that the e-mail address [email protected] is valid User account created You will be redirected in 3 seconds... It also looks like they won't enable it. So is their away I can get around this by using my own smtp server or something like that. or does anyone know a freeweb hosting site that I can use that supports this and also supports php5 and mysql 5.0(eventhough I might be able to get away with a older version since all I have is a simple table). Thanks Link to comment https://forums.phpfreaks.com/topic/46036-need-help-with-mail-function/ Share on other sites More sharing options...
Dragen Posted April 7, 2007 Share Posted April 7, 2007 Hi, You should be able to use php 4 with a simple script like that. Try this host.. I use them and they seem quite good, although I have a paid account. I just checked the stats of the trial account and it looks like you can use mail() function on it. I know you can for paid and I see no restriction on the list of options for the free one. https://www.streamlinenet.co.uk Hope this helps Link to comment https://forums.phpfreaks.com/topic/46036-need-help-with-mail-function/#findComment-223789 Share on other sites More sharing options...
chobo2 Posted April 7, 2007 Author Share Posted April 7, 2007 Hi, You should be able to use php 4 with a simple script like that. Try this host.. I use them and they seem quite good, although I have a paid account. I just checked the stats of the trial account and it looks like you can use mail() function on it. I know you can for paid and I see no restriction on the list of options for the free one. https://www.streamlinenet.co.uk Hope this helps Hmm I don't have a credit card so I can't sign up. Link to comment https://forums.phpfreaks.com/topic/46036-need-help-with-mail-function/#findComment-223791 Share on other sites More sharing options...
Dragen Posted April 7, 2007 Share Posted April 7, 2007 oh sorry. I hadn't realised you had to put credit card details in for trial user.. I also just noticed that it's a 3 month trial.. not a free account type thing. Sorry. Try googling for a host. Link to comment https://forums.phpfreaks.com/topic/46036-need-help-with-mail-function/#findComment-223793 Share on other sites More sharing options...
chobo2 Posted April 7, 2007 Author Share Posted April 7, 2007 oh sorry. I hadn't realised you had to put credit card details in for trial user.. I also just noticed that it's a 3 month trial.. not a free account type thing. Sorry. Try googling for a host. Been googling for like the last hour and found nothing that has it enabled Link to comment https://forums.phpfreaks.com/topic/46036-need-help-with-mail-function/#findComment-223796 Share on other sites More sharing options...
Dragen Posted April 7, 2007 Share Posted April 7, 2007 ah. that's why I decided to pay for hosting. I was fed up with so little options and all the banner ads everywhere.. Link to comment https://forums.phpfreaks.com/topic/46036-need-help-with-mail-function/#findComment-223801 Share on other sites More sharing options...
chobo2 Posted April 7, 2007 Author Share Posted April 7, 2007 ah. that's why I decided to pay for hosting. I was fed up with so little options and all the banner ads everywhere.. Ya well I just need something that I can use till the end of the month since this is for a project and most of my school computers don't have it setup(or I don't know how access it) and my teacher who is marking this does not really want to set it up(this is for a competion but my teacher is allowing us to do this instead of one of are asp assignments so thats why nothing is really setup for php or if it is I don't know how to access it.) Link to comment https://forums.phpfreaks.com/topic/46036-need-help-with-mail-function/#findComment-223810 Share on other sites More sharing options...
Dragen Posted April 7, 2007 Share Posted April 7, 2007 If it's only for a month, if you like I could set up a temporary sub-domain on my host for you to use. You'd have ftp access and everything. Then I'll delete the sub-domain sometime next month. Link to comment https://forums.phpfreaks.com/topic/46036-need-help-with-mail-function/#findComment-223815 Share on other sites More sharing options...
chobo2 Posted April 7, 2007 Author Share Posted April 7, 2007 Really wow thanks that would be so cool. So I would be able to make a database and everything? if you want I can send you my code and stuff so you can prescreen it if you worried about security or anything like that. Link to comment https://forums.phpfreaks.com/topic/46036-need-help-with-mail-function/#findComment-223818 Share on other sites More sharing options...
Dragen Posted April 7, 2007 Share Posted April 7, 2007 yeah okay. It's a uk hosted site though, so if I register the sub-domain tonight it probably wont be up until monday GMT. Do you have any preference for the sub-domain name? Link to comment https://forums.phpfreaks.com/topic/46036-need-help-with-mail-function/#findComment-223826 Share on other sites More sharing options...
chobo2 Posted April 7, 2007 Author Share Posted April 7, 2007 yeah okay. It's a uk hosted site though, so if I register the sub-domain tonight it probably wont be up until monday GMT. Do you have any preference for the sub-domain name? you can call it after my school BCIT. Ok cool that should be fine I still have to wait to get the design part of the site(if my group members do it) then put my login & registration form into it. So Monday should be fine. Thanks again. Link to comment https://forums.phpfreaks.com/topic/46036-need-help-with-mail-function/#findComment-223829 Share on other sites More sharing options...
Dragen Posted April 7, 2007 Share Posted April 7, 2007 okay. Linux or windows? Link to comment https://forums.phpfreaks.com/topic/46036-need-help-with-mail-function/#findComment-223836 Share on other sites More sharing options...
chobo2 Posted April 7, 2007 Author Share Posted April 7, 2007 okay. Linux or windows? Windows. Link to comment https://forums.phpfreaks.com/topic/46036-need-help-with-mail-function/#findComment-223837 Share on other sites More sharing options...
Dragen Posted April 7, 2007 Share Posted April 7, 2007 You sure? I'd suggest Linux, but it's whatever you prefer I guess. Link to comment https://forums.phpfreaks.com/topic/46036-need-help-with-mail-function/#findComment-223842 Share on other sites More sharing options...
chobo2 Posted April 7, 2007 Author Share Posted April 7, 2007 You sure? I'd suggest Linux, but it's whatever you prefer I guess. Well what would this exactly be for? I made all this in windows and stuff(but that should not really matter) and my linux expirence is as good as my php skills(so not very good lol) Link to comment https://forums.phpfreaks.com/topic/46036-need-help-with-mail-function/#findComment-223846 Share on other sites More sharing options...
Dragen Posted April 7, 2007 Share Posted April 7, 2007 the operating system you use has nothing to do with the server type. Windows type of hosting can take up a lot of extra space, but is more user friendly, whereas linux is the bare bones, just what you need. I guess as you're only going to be using ftp to upload stuff and phpmyadmin for databases I'd use Linux, because otherwise I'll end up with quite a bit of space taken up by windows stuff that's not needed. Host type has nothing to do with operating system. I use windows xp on my computer but my hosting is Linux.. it's also generally cheaper on most hosts Link to comment https://forums.phpfreaks.com/topic/46036-need-help-with-mail-function/#findComment-223849 Share on other sites More sharing options...
chobo2 Posted April 7, 2007 Author Share Posted April 7, 2007 the operating system you use has nothing to do with the server type. Windows type of hosting can take up a lot of extra space, but is more user friendly, whereas linux is the bare bones, just what you need. I guess as you're only going to be using ftp to upload stuff and phpmyadmin for databases I'd use Linux, because otherwise I'll end up with quite a bit of space taken up by windows stuff that's not needed. Host type has nothing to do with operating system. I use windows xp on my computer but my hosting is Linux.. it's also generally cheaper on most hosts Ok whatever you think is best since you obviously know more then me. If I have any questions I will just ask you. Just set it up so I can't screw any of your stuff up(since thats the last thing I would want to do to you.) Link to comment https://forums.phpfreaks.com/topic/46036-need-help-with-mail-function/#findComment-223851 Share on other sites More sharing options...
Dragen Posted April 8, 2007 Share Posted April 8, 2007 haha. you shouldn't be able to touch any of my stuff as they're on seperate servers. I'll pm you the login details once they're set up. Link to comment https://forums.phpfreaks.com/topic/46036-need-help-with-mail-function/#findComment-223862 Share on other sites More sharing options...
chobo2 Posted April 8, 2007 Author Share Posted April 8, 2007 haha. you shouldn't be able to touch any of my stuff as they're on seperate servers. I'll pm you the login details once they're set up. ok thanks I will send you my email(through pm) instead of you sending me pm once setup. Since I may forget to check to see if I gotten any messages. Link to comment https://forums.phpfreaks.com/topic/46036-need-help-with-mail-function/#findComment-223868 Share on other sites More sharing options...
Dragen Posted April 8, 2007 Share Posted April 8, 2007 okay. Link to comment https://forums.phpfreaks.com/topic/46036-need-help-with-mail-function/#findComment-223870 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.