473,396 Members | 2,052 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Problem in mail sending

118 100+
Hi,

i placed the php in windows server 2003 manually , set the path in Environmental variables , and place the php.ini file in windows.
Now php works fine in my server sytem.When i write the mail sending code and run that program mail didn't sent.
in my php.ini file consists the
smtp=localhost
smtp_port=25
sendmail_from=me@localhost.com
In my smtp settings:
Internet Information Services->righclick on default virtual smtp server->properties->Access tab->Relay->add the my system IP address and 127.0.0.1 ip address .

We think there is no problem from smtp settings.Because we run the jsp mail sending in same server machine .It works fine and mail sent .

Here is the php code we have used
Expand|Select|Wrap|Line Numbers
  1. <?php
  2. $to ="email@domain.com";
  3. $subject = "Test Mail";
  4. $message = "hello how are you";
  5. $headers = "MIME-Version: 1.0\n";
  6. $headers .= "Content-type: text/html; charset=iso-8859-1\n";
  7. $headers .= "X-Priority: 3\n";
  8. $headers .= "X-MSMail-Priority: Normal\n";
  9. $from = "me@example.com";
  10. $headers .= "From: $from";
  11. mail($to,$subject,$message,$headers);
  12. ?>
  13.  
Please tell that whats the probelem in that.
Jan 31 '09 #1
3 1675
Dormilich
8,658 Expert Mod 8TB
PHP's mail() function doesn't use the smtp server. (see manual entry below)

if you want to use your smtp server, try Swift Mailer or PHP Mailer
Requirements

For the Mail functions to be available, PHP must have access to the sendmail binary on your system during compile time. If you use another mail program, such as qmail or postfix, be sure to use the appropriate sendmail wrappers that come with them. PHP will first look for sendmail in your PATH, and then in the following: /usr/bin:/usr/sbin:/usr/etc:/etc:/usr/ucblib:/usr/lib. It's highly recommended to have sendmail available from your PATH. Also, the user that compiled PHP must have permission to access the sendmail binary.
Jan 31 '09 #2
dlite922
1,584 Expert 1GB
Does your smtp server require a username and password or authentication?


Dan

@swethak
Feb 1 '09 #3
swethak
118 100+
@dlite922

No.I put the option as Anonymous access.So i didn't set the username and password.

Please give the suggestion.
Feb 2 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Mike the Canadian | last post by:
I am having a very strange problem sending email with php. I have two domains. I can send an email to one domain using php but not the other. If I put both email addresses in the mail command only...
3
by: VB Programmer | last post by:
I have an ASPX page where I send out emails through my mail server mail.MyDomain.com. When I send emails to MyName@MyDomain.com it sends PERFECTLY. When I try sending an email to any other address...
4
by: splicemix | last post by:
Hi all, I have recently set up a Drupal website. I am a beginner. My shared host server does not allow nobody@localhost to send emails, and prevents access to php.ini, so I spent some time...
4
by: k.visube | last post by:
In my ASP application,i need to send a formatted text mail (i.e with newline characters). here in my application i used a function in javascript which construts the mail body sample snippet ...
2
by: =?Utf-8?B?YmFyYnlxMTA=?= | last post by:
After sending mail, it leaves the outbox as normal and clears and hits the sent folder, but then I get a popup box that states EMAIL PROBLEM One or more e-mail messages cannot be sent. ...
9
by: sweatha | last post by:
Hi I have the normal server and not the SMTP service installed. I need to send a mail once if I click a button. Can anybody help me regarding that
6
by: cnsabar | last post by:
Hi., I am using following code to send sms through e-mail use Mail::Sendmail; %mail = (To => '10digitMobileNo@airtelkk.com', From => "mymail\@company.com", Message =>...
0
Dormilich
by: Dormilich | last post by:
this is a follow-up thread to this one. http://bytes.com/topic/html-css/answers/863662-form-not-submitted-sometimes I figured out that the mail sending class triggers the described error....
2
ThatThatGuy
by: ThatThatGuy | last post by:
Hello reader,, This might be a very simple question, but what to just say about it, i'm facing it Actually i'm developing a web App and i want email feature in that.... I'm sending mail from my...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.