tags:

views:

751

answers:

3

I want a PHP code to send a mail using dreamhost.com what will be the code........ I know that SMTP must be use to send the mail. So please anyone who have code please give it.......

+3  A: 

Try this: http://stackoverflow.com/questions/1825414/use-php-mail-to-send-via-smtp

Jimmie Lin
+1. See also http://stackoverflow.com/questions/1058826/how-to-send-mails-through-php-script/1058856#1058856
micahwittman
A: 

The best option would be to use the PEAR Mail Package (Here's how to use it) which may be already installed on your server. (Especially if you are using xampp or something similar.)

You can also edit your php.ini file like this:

 [mail function]
 SMTP = smtp.dreamhost.com
 sendmail_from = [email protected]
Chaim Chaikin
+1  A: 

If you use a library like SwiftMailer it's quite simple. Have a look at their docs.

Blair McMillan
+1 for SwiftMailer
WishCow