Mail Server Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsSystem AdministrationMail Server Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rating: Thread Rating: 2 votes, 1.00 average. Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 16th, 2003, 03:36 PM
TravPro TravPro is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 24 TravPro User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
how to set up php.ini to send mail from local machine

I have php running wonderfully on my local win2000 machine yet don't know what to do in order to send mail using php and calling the mail function.

My internet provider requires an outgoing mail server username and password which is no problem when using Outlook as there is a proper space to enter it, is this even an issue??? Seems like it would be.

Here is my php code which works just fine on the remote server: <b>mail($to, $subject, $body, $headers); </b>

What do I put in my local machine php.ini file and where? Or other tips, thanks so much.

Last edited by TravPro : December 16th, 2003 at 04:04 PM.

Reply With Quote
  #2  
Old December 17th, 2003, 02:21 PM
alexgreg's Avatar
alexgreg alexgreg is offline
Full Access
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jun 2000
Location: London, UK
Posts: 2,019 alexgreg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 sec
Reputation Power: 16
Change:
Code:
[mail function]
; For Win32 only.
SMTP = localhost

to
Code:
[mail function]
; For Win32 only.
SMTP = mail.yourprovider.com

where mail.yourprovider.com is your ISP's SMTP server.
Comments on this post
valexa agrees!
__________________
Alex
(http://www.alex-greg.com)

Reply With Quote
  #3  
Old December 18th, 2003, 09:27 AM
TravPro TravPro is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 24 TravPro User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I tried using that line but received the following error:

Warning: mail(): SMTP server response: 553 Invalid address syntax on the line of code which has mail($to, $subject, $body, $headers);

Not sure why this would happen, doesn't even seem like it's making it to the smtp part. What about the fact that my ISP requires a username and password for sending mail in apps. such as Outlook Express?

Thanks so much.

Reply With Quote
  #4  
Old December 20th, 2003, 07:13 PM
alexgreg's Avatar
alexgreg alexgreg is offline
Full Access
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jun 2000
Location: London, UK
Posts: 2,019 alexgreg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 sec
Reputation Power: 16
Quote:
Warning: mail(): SMTP server response: 553 Invalid address syntax on the line of code which has mail($to, $subject, $body, $headers);

Could you post the rest of the code - i.e. where the variables get defined?
Quote:
Not sure why this would happen, doesn't even seem like it's making it to the smtp part.

It is making it to the SMTP part -- the message "553 Invalid address syntax" comes from your ISP's SMTP server.
Quote:
What about the fact that my ISP requires a username and password for sending mail in apps. such as Outlook Express?

You won't be able to send email through it in this case -- the SMTP server you specify must be configured to relay mail from your server.

There may be a third-party PHP SMTP class available which does SMTP authentication; have a look on Google.

Reply With Quote
  #5  
Old July 6th, 2005, 05:18 PM
broncozr broncozr is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2005
Posts: 8 broncozr User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 3 m 40 sec
Reputation Power: 0
Gmail | Outlook

Hi,

Along these lines, is there any way to authenticate my gmail username and password (pass them in the mail funtion) so that I can send mail from my gmail account? If not, can I show the Outlook path in my php.ini file so as to use Outlook to send mail through my gmail account. I have set my SMTP and port to match my Outlook settings (which works fine in Outlook for sending/receiving from gmail).

Like TravPro, I'm running php on a local machine for debugging and would like to explore using php to send mail....

Thanks for any ideas.

Reply With Quote
  #6  
Old July 7th, 2005, 10:46 AM
edwinbrains's Avatar
edwinbrains edwinbrains is offline
Retired Moderator
Dev Shed God 4th Plane (6500 - 6999 posts)
 
Join Date: Jan 2004
Location: London, UK
Posts: 6,669 edwinbrains User rank is First Lieutenant (10000 - 20000 Reputation Level)edwinbrains User rank is First Lieutenant (10000 - 20000 Reputation Level)edwinbrains User rank is First Lieutenant (10000 - 20000 Reputation Level)edwinbrains User rank is First Lieutenant (10000 - 20000 Reputation Level)edwinbrains User rank is First Lieutenant (10000 - 20000 Reputation Level)edwinbrains User rank is First Lieutenant (10000 - 20000 Reputation Level)edwinbrains User rank is First Lieutenant (10000 - 20000 Reputation Level)edwinbrains User rank is First Lieutenant (10000 - 20000 Reputation Level)  Folding Points: 85411 Folding Title: Advanced FolderFolding Points: 85411 Folding Title: Advanced FolderFolding Points: 85411 Folding Title: Advanced FolderFolding Points: 85411 Folding Title: Advanced FolderFolding Points: 85411 Folding Title: Advanced Folder
Time spent in forums: 2 Weeks 2 h 35 m 51 sec
Reputation Power: 146
Quote:
Originally Posted by broncozr
Along these lines, is there any way to authenticate my gmail username and password (pass them in the mail funtion) so that I can send mail from my gmail account?


So you want to send mail using the SMTP server smtp.gmail.com? As alexgreg posted above, I don't think there's a way to do this using the mail function since you can't enter your gmail username/password (and it appears that smtp.gmail.com requires authentication). However, there will be scripts around on the internet that support authentication that you can use instead.

Quote:
Originally Posted by broncozr
If not, can I show the Outlook path in my php.ini file so as to use Outlook to send mail through my gmail account.


You just want to use smtp.gmail.com as your outgoing SMTP server in Outlook? If so, see this link:

http://mail.google.com/support/bin/...f&ctx=en:search
__________________
- Edwin -

The General Rules Thread | The General FAQ Thread

Reply With Quote
  #7  
Old July 7th, 2005, 09:15 PM
broncozr broncozr is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2005
Posts: 8 broncozr User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 3 m 40 sec
Reputation Power: 0
Quote:
Originally Posted by edwinbrains
So you want to send mail using the SMTP server smtp.gmail.com? As alexgreg posted above, I don't think there's a way to do this using the mail function since you can't enter your gmail username/password (and it appears that smtp.gmail.com requires authentication). However, there will be scripts around on the internet that support authentication that you can use instead.


Thanks for the response...

I don't necessarily have to use gmail. I have an AOL account, but I'm trying to end that! I would use any mail program/site that I could find to just learn something about the mail() function in PHP. I'm running Apache2.0 on WindowsXP (PHP4.3).
I don't have a "real" website yet, just the free one from Yahoo! So... I'm trying to get some experience on my local machine while I learn PHP. In the end, I would like to be able to establish a large mailing list based on user input, and then I would like to be able to send mass emails for a possible commercial site. I don't know if PHP mail() is amenable to large email-mailings; I have read that other extensions are better at that type of thing.

Quote:
Originally Posted by edwinbrains
You just want to use smtp.gmail.com as your outgoing SMTP server in Outlook? If so, see this link:

http://mail.google.com/support/bin/...f&ctx=en:search


I have Outlook set up to use gmail's smtp server, and that's going well. I was kind of poking around in the dark hoping that I could piggyback on my already configured Outlook? Probably not possible?

Thanks again!

Reply With Quote
  #8  
Old July 8th, 2005, 10:00 AM
edwinbrains's Avatar
edwinbrains edwinbrains is offline
Retired Moderator
Dev Shed God 4th Plane (6500 - 6999 posts)
 
Join Date: Jan 2004
Location: London, UK
Posts: 6,669 edwinbrains User rank is First Lieutenant (10000 - 20000 Reputation Level)edwinbrains User rank is First Lieutenant (10000 - 20000 Reputation Level)edwinbrains User rank is First Lieutenant (10000 - 20000 Reputation Level)edwinbrains User rank is First Lieutenant (10000 - 20000 Reputation Level)edwinbrains User rank is First Lieutenant (10000 - 20000 Reputation Level)edwinbrains User rank is First Lieutenant (10000 - 20000 Reputation Level)edwinbrains User rank is First Lieutenant (10000 - 20000 Reputation Level)edwinbrains User rank is First Lieutenant (10000 - 20000 Reputation Level)  Folding Points: 85411 Folding Title: Advanced FolderFolding Points: 85411 Folding Title: Advanced FolderFolding Points: 85411 Folding Title: Advanced FolderFolding Points: 85411 Folding Title: Advanced FolderFolding Points: 85411 Folding Title: Advanced Folder
Time spent in forums: 2 Weeks 2 h 35 m 51 sec
Reputation Power: 146
Well the only SMTP servers you seem to have access to require authentication which you can't do using the mail() function. I just did a quick Google search, and I think you want PHPMailer. That way you could use this class to send mail from your computer using the Gmail SMTP servers (entering your Gmail username and password).

Otherwise you could always setup your own SMTP server so you wouldn't have to use Gmail. If you were using Linux, this would be easy to do (sendmail, for example) but it shouldn't be too hard with Windows. Just try searching Google for "freeware smtp server windows" perhaps.

Reply With Quote
  #9  
Old July 8th, 2005, 11:34 AM
broncozr broncozr is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2005
Posts: 8 broncozr User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 3 m 40 sec
Reputation Power: 0
Thanks

Thanks for the ideas! I'll give them a try....

Reply With Quote
  #10  
Old August 24th, 2005, 11:17 AM
cool sagar cool sagar is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2005
Posts: 2 cool sagar User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 29 m 55 sec
Reputation Power: 0
sending mail from localhost

Quote:
Originally Posted by alexgreg
Change:
Code:
[mail function]
; For Win32 only.
SMTP = localhost

to
Code:
[mail function]
; For Win32 only.
SMTP = mail.yourprovider.com

where mail.yourprovider.com is your ISP's SMTP server.




I just did that.
The page is opening and the command is successfully executed but there is no result ; i mean the mail is not sent but it shows no error

Reply With Quote
  #11  
Old September 25th, 2005, 08:30 PM
cjXXI cjXXI is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 3 cjXXI User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 12 m 15 sec
Reputation Power: 0
IT WORKED!!!!

I was having the same problem,

and I just changed the smtp server instead of localhost
and now it works!!!!!!!!!!!!








thank you!!!''


Reply With Quote
  #12  
Old May 24th, 2011, 04:49 PM
paff paff is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2011
Posts: 6 paff User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 27 m 54 sec
Reputation Power: 0
how to connect to send mail from my localhost

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationMail Server Help > how to set up php.ini to send mail from local machine

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap