Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

form to email question


  • Please log in to reply
14 replies to this topic

#1 nixx

nixx

  • Members
  • 159 posts
  • OFFLINE
  •  
  • Local time:04:02 PM

Posted 19 March 2009 - 09:32 PM

Hi,

total n00b here.

I just wanted to know how you could set a contact form to send to an email address on submit. I downloaded uniform server already, I have no idea how to call the phpmailer v2.3 (don't even know if that's the one I should use).

Can anybody here help me? It'll be greatly appreciated :thumbsup:

Thanks!

BC AdBot (Login to Remove)

 


#2 burn1337

burn1337

  • Banned
  • 311 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:12:02 AM

Posted 19 March 2009 - 10:12 PM

in the form use the action property set it to mailto:email@bleh.com "<form method=post action=mailto:joebob@bob.com>", or you could also use the php mailer, set the entire email in variables then "mail($To, $Subject, $Message, $Additional_Headers, $Additional_Parameters);" Additional_Headers can have like From CC, Bcc, ect... For more information on that ... http://us3.php.net/manual/en/function.mail.php That is the page...

#3 nixx

nixx
  • Topic Starter

  • Members
  • 159 posts
  • OFFLINE
  •  
  • Local time:04:02 PM

Posted 22 March 2009 - 09:15 PM

hmmm well, using the mailto:email@email.com isn't really what I'm hoping to achieve. I want the form to send it directly to an email account (gmail). I've read that you could use it as an smtp server although I don't quite get how to install it. There are also a lot of phpmailers in the sourceforge.net website and I don't know which one I should use. Forgive my ignorance regarding these things.

Thanks for the reply

#4 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:02:02 AM

Posted 22 March 2009 - 10:02 PM

Do you have a domain name? Otherwise your options are a bit limited as to what you can do. A little more info about your setup would be helpful, especially things like whether or not you have a static or dynamic ip address, whether or not your IP allows SMTP connections, etc.

#5 KamakaZ

KamakaZ

  • Members
  • 739 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Victoria
  • Local time:07:02 PM

Posted 22 March 2009 - 10:06 PM

I had this same problem not to long ago...

I ended up installing a SMTP server and configured it to forward my mail to a windows live email address. I agree with groovicus, more info would be handy.

One thing i don't like about the action="mailto..." bit is it relies on the client to have a mail program installed AND be using it! I have Outlook installed, but do not use it, so this would cause a problem.

You could use something like this http://www.ibdhost.com/contact/

Edited by KamakaZ, 22 March 2009 - 10:26 PM.

There's no place like 127.0.0.1
There are 10 types of people in the world, those that can read binary, and those who can't.


#6 nixx

nixx
  • Topic Starter

  • Members
  • 159 posts
  • OFFLINE
  •  
  • Local time:04:02 PM

Posted 22 March 2009 - 10:24 PM

I actually don't have one yet, I'm just using a free hosting service at the moment since I don't really wanna pay until I know what I'm supposed to do. Would that mean trying to send an email to a gmail account wouldn't be possible right now? Sorry, I'm really clueless

#7 KamakaZ

KamakaZ

  • Members
  • 739 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Victoria
  • Local time:07:02 PM

Posted 22 March 2009 - 10:37 PM

I have also used this to great success in the past. It will also explain what it's doing along the way.

http://www.kirupa.com/web/php_contact_form.htm

Try googling "php contact form" not to sure whether free sites have restrictions or not as i have never used one. What is the name of the free site company you are using? Someone else might know more about them than i do...

I dare say you wouldn't be able to install a smtp server on the free site.

Edited by KamakaZ, 22 March 2009 - 10:38 PM.

There's no place like 127.0.0.1
There are 10 types of people in the world, those that can read binary, and those who can't.


#8 nixx

nixx
  • Topic Starter

  • Members
  • 159 posts
  • OFFLINE
  •  
  • Local time:04:02 PM

Posted 22 March 2009 - 10:39 PM

Alright, I'll check that link out.

The hosting is http://www.sitesled.com by the way

Edited by nixx, 22 March 2009 - 10:40 PM.


#9 burn1337

burn1337

  • Banned
  • 311 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:12:02 AM

Posted 23 March 2009 - 06:21 PM

Ok so I send out emails with my website, the problem with sending emails to gmail, is that if you are not on a static ip, it will not accept the email (as well as other email servers i.e. yahoo), also you don't need an smtp server installed (I never did), although you do need to make sure you have the smtp port allowable with your firewall... With that method all you have to do is the php function I stated earlier... mail($To, $Subject, $Message, $Additional_Headers);

If for some reason you do need an smtp server, you host should already have that available to you... Also with your host, it could be blocking smtp and pop3 or any other protocol for sending emails...

#10 KamakaZ

KamakaZ

  • Members
  • 739 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Victoria
  • Local time:07:02 PM

Posted 23 March 2009 - 09:57 PM

Ok so I send out emails with my website, the problem with sending emails to gmail, is that if you are not on a static ip, it will not accept the email (as well as other email servers i.e. yahoo), also you don't need an smtp server installed (I never did), although you do need to make sure you have the smtp port allowable with your firewall... With that method all you have to do is the php function I stated earlier... mail($To, $Subject, $Message, $Additional_Headers);

If for some reason you do need an smtp server, you host should already have that available to you... Also with your host, it could be blocking smtp and pop3 or any other protocol for sending emails...


Good point about the static IP. Since he is going through a free site, i'm guessing they would have a static IP.

You don't need an SMTP server?!? How else do you send mail?!?

"Port allowable with YOUR firewall"? He is using a free host, you just told him NOT to install a SMTP server, the method that you stated earlier uses the php mail() function, which is set in the php.ini which requires a SMTP server!

There's no place like 127.0.0.1
There are 10 types of people in the world, those that can read binary, and those who can't.


#11 burn1337

burn1337

  • Banned
  • 311 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:12:02 AM

Posted 24 March 2009 - 02:54 AM

Well pardon me KamakaZ, but as I said I never HAD to install an SMTP server on my server the first time I laid it out to send emails, I got the emails through some hosts and not through others, the server I have installed now, I installed the SMTP server with the os... Not all free hosts use static Ip's, I have seen a fare share that use Dynamic Ip's... So if it is necessary to use the SMTP server, pardon me, but as I said, I didn't have to... Also I have seen many ways of getting around needing an SMTP server to send mail...

#12 KamakaZ

KamakaZ

  • Members
  • 739 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Victoria
  • Local time:07:02 PM

Posted 24 March 2009 - 07:15 PM

90% of the time you would use a mail server of some sort, or send it through someone else's server (relay).

I haven't used many free hosts, but the one's that i have used static IP's, luck of the draw i guess...

I'm interested in how you managed not to use a smtp server in the past, any more details?

For someone with not much experience i'd say php scripts for sending mail would be difficult, but then again smtp servers aren't easy either...

There's no place like 127.0.0.1
There are 10 types of people in the world, those that can read binary, and those who can't.


#13 burn1337

burn1337

  • Banned
  • 311 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:12:02 AM

Posted 24 March 2009 - 10:55 PM

Well actually you can use the http daemon as an smtp server without having to use an smtp server... Also I remember when I first started to get into computers and networking pop3 was usable for both sending and receiving emails (I could be wrong I was 11)... Also as you said you can use it as a relay, you can actually use a router as the relay... With the linux/unix platforms, I have set up more then a few boxes that could send out emails without ever using smtp, though the smtp port did need to be allowable, the same daemon used to send messages between users, can also be used to send emails to people, and as I said before you can also use the http daemon, for instance, you can normally choose to use an http server as an smtp server as well, in the configuration scripts.
As for sending mail through php scripts, though I am not a beginner, I found it to be pretty easy, the only hard part is the additional headers, which is optional...
On free hosts, it really depends, sometimes you get the ones with static-ips, and sometimes you get a dynamic ip.... Though I would imagine that now days, there are fewer and fewer with dynamic ips...

#14 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:02:02 AM

Posted 25 March 2009 - 09:34 AM

the only hard part is the additional headers, which is optional.


Which of course will cause most email servers to reject the email as spam, since this is a common spammer technique.

For the record, I know of no hosting companies with dynamic IPs, nor would it make any sense simply because every time the IP address changes, the server then needs to notify the domain servers of the change, which can take up to 48 hours (or even longer) to propagate around the world. I don't suppose too many people would like it if their web page suddenly was unavailable for 2 days. :thumbsup:

#15 burn1337

burn1337

  • Banned
  • 311 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:12:02 AM

Posted 26 March 2009 - 04:08 PM

That is true, I haven't looked for hosting services in a while, I would suppose that, that has changed... But I have seen some that have used dynamic ips, though I doubt any of them are still in business lol...




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users