Current location: Hot Scripts Forums » Programming Languages » PHP » help with mail func


help with mail func

Reply
  #1 (permalink)  
Old 11-12-11, 12:49 AM
Aaronb Aaronb is offline
New Member
 
Join Date: Nov 2011
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
help with mail func

hi all Im using wamp 2.0 because i couldnt get wamp 5 to work. Any way Im having trouble with the mail function this is what my ISP told me-


The type is pop3. The incoming needs to be pop.centurylink.net
and the outgoing needs to be smtp.centurylink.net
and the incoming port needs to be 110 and the outgoing port needs to be 587. also make sure that use SSL is not selected and outgoing server requires authentication is selected. the account name needs to have the entire email address including the @centurylink.net.


And this is my code-


$to = $email;
$subject = "subject here";
$message = "message goes here<br />"
. $name . "," . $name2;
$from = "site name";
$headers = "From:" . $from;
mail($to,$subject,$message,$headers);


and this is from my php.ini file thats path is C:\wamp\bin\php\php5.3.0-


[mail function]
; For Win32 only.
; http://php.net/smtp
SMTP = smtp@centurylink.com
; http://php.net/smtp-port
smtp_port = 587
; For Win32 only.
; http://php.net/sendmail-from
sendmail_from = smtp@centurylink.com

and this is the error I get-

Warning: mail() [function.mail]: Failed to connect to mailserver at "smtp@centurylink.com" port 587, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in on line 178


Can somebody please tell me whats wrong

Last edited by Aaronb; 11-12-11 at 12:51 AM.
Reply With Quote
  #2 (permalink)  
Old 11-16-11, 01:10 AM
phplabs phplabs is offline
Newbie Coder
 
Join Date: Oct 2011
Posts: 37
Thanks: 0
Thanked 7 Times in 7 Posts
SMTP = smtp.centurylink.net

since your isp said that the smtp server requires authentication, if you get some authentication related errors when you fix the 'smtp' setting, you might also need to set the following values:

auth_username=
auth_password=


__________________
blog.phplabs.net
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Send mail authentication sujata_ghosh Perl 9 06-24-08 12:45 AM
Attachement help needed sujata_ghosh Perl 18 06-22-07 01:00 PM
file attachment problem on email script sujata_ghosh Perl 2 01-11-07 01:17 AM
hotmail and send mail func hossamhamdi1986 PHP 3 04-17-06 02:51 PM
what's the difference between this two messages (( mail func )) hossamhamdi1986 PHP 2 02-26-06 09:19 PM


All times are GMT -5. The time now is 08:53 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.