473,569 Members | 2,844 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Mail function not working properly

119 New Member
Hi,

I am using mail function in my php page, As soon i update the details, i have to send mail to the customer with the updated details,

problem is when i send mail it simple through waring msg as:

Waring mail() [function mail]: SMPT sever response: 550 Relaying not allowed in d:/wamp/update.php
can anyone help me why such problem occurs, how to over come this problem.

Thanks in advance,

Regards,
magesh
Oct 22 '09 #1
6 5181
Dormilich
8,658 Recognized Expert Moderator Expert
what’s the code you use?
Oct 22 '09 #2
phpmagesh
119 New Member
Expand|Select|Wrap|Line Numbers
  1.  
  2. $to  = get_mail($phnumber);  // retrive mail id based on there ph number    
  3. $subject = 'order details';
  4.  
  5. $message .= 'Order Details'; // html body
  6.  
  7. // To send HTML mail, the Content-type header must be set
  8. $headers  = 'MIME-Version: 1.0' . "\r\n";
  9. $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
  10.  
  11. // Additional headers
  12. $headers .= 'To: '. $to . "\r\n";
  13. $headers .= 'From: <order@example.com>' . "\r\n";
  14.  
  15. // Send Mail
  16. mail($to, $subject, $message, $headers);    
  17.  
  18.  
This is the simple code i used here, but no use of it, mail goes once for 5 times, other mail returns with above said Warning

please help how to over come this,

Thanks in advance

Regards,
Oct 22 '09 #3
Dormilich
8,658 Recognized Expert Moderator Expert
how does $to look like?
Oct 22 '09 #4
phpmagesh
119 New Member
@Dormilich
k then make it as

$to = 'magesh.apr@exa mple.com';

the final $to value will be this only.

Thanks,

Regards
Oct 22 '09 #5
Dormilich
8,658 Recognized Expert Moderator Expert
probably the Windows sentmail chokes on <order@example. com>. try it without < >, although the error implies that example.com is not your current host name…
Oct 22 '09 #6
rehriff
1 New Member
How To: PHP Sendmail and XAMPP on Windows

It can be difficult getting the PHP’s default mail functions to work when you run an apache server on windows instead of a unix environment. I ran into this problem with my server (running XAMPP), and thought others may benefit from a quick how-to. Another slight problem I had to get working was using an SMTP server that requires SSL connections (gmail for one). I didn’t realize that most recent XAMPP releases have sendmail built in already. This takes part of the hassel out, but we still have some configuring to do.
First, ensure that you have an XAMPP release that does include the fake sendmail program. [More details here]
Next, go to the XAMPP directory (often C:\xampp\), then open the ’sendmail’ subdirectory. You’ll most likely see the following files (default):
sendmail.exe
readme.html
sendmail.ini
sendmail_exampl e.ini
license.html
Open the file sendmail.ini – this is where all of your SMTP server configurations will go, for example: SMTP Username, Password, Host, Port, etc
My sendmail.ini file looks something like this:
; configuration for fake sendmail
[sendmail]
smtp_server=smt p.gmail.com
smtp_port=465
; SMTPS (SSL) support
; auto = use SSL for port 465, otherwise try to use TLS
; ssl = alway use SSL
; tls = always use TLS
; none = never try to use SSL
smtp_ssl=auto
default_domain= google.com
error_logfile=e rror.log
; if your smtp server requires authentication, modify the following two lines
auth_username=< USERNAME / EMAIL ADDRESS HERE>
auth_password=< PASSWORD HERE>
Note that this is a very simple setup. The variable names are fairly obvious, so simply fill in the SMTP server, port, ssl mode, username, password, and default domain / error log if you’d like.
GMail requires an SSL connection, so my config was setup to use SSL port 465 and smtp_ssl=auto. If SSL is not necessary for your SMTP server, simply set smtp_ssl=none.
Once the configuration is setup, make sure to save changes, then exit.
If you are going to use SSL connections, you will need two additional files, available here "http://glob.com.au/sendmail/sendmail-SSL.zip" (as of March 2009) – if this link no longer works, use the contact form and let me know.
Extract the two compressed files (libeay32.dll and ssleay32.dll) to the same directory as sendmail.exe (for me, C:\xampp\sendma il\)
Now, everything on the sendmail’s end is setup – now we just need to let the server know its there!
Edit your PHP.ini file:
XAMPP installations often have multiple files. If you are doubtful of the correct one, you can always go through and change them all. But before you do that, change the php.ini in \xampp\apache\b in\.
Look for the following line:

sendmail_path = " \“C:\xampp\send mail\sendmail.e xe \" -t”
Uncomment the line (if already commented) by removing the semicolon at the start.
Ensure that the path to sendmail.exe is correct (this is correct for me).
Save and exit php.ini
Restart the apache server and everything should work!
Comment if you have a question.
Nov 25 '09 #7

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

Similar topics

1
1650
by: tzuccolo2001 | last post by:
I'm trying to send an email using the mail() function. I've carefully made use of the ini_set(SMTP, "mail.my.server") function to set my SMTP server and also to set my From: address. I'm still getting a "Relaying not explicitly allowed: fakeemail@fakedomain.com" response from the server however, when I try and set a recipient who is outside of...
6
11167
by: DigitalRick | last post by:
I have been running CDONTS in my ASPpages to send emails to me sent from my guestbook. It had been working fine untill I upgraded to Server 2003 (I am also running Exchange 2003) all locally. I will include the code I originally used. I understand I should switch from CDONTS to CDO mail but after several sttempts I am finding a very hard...
8
5459
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- Hello, I have a very simple problem but cannot seem to figure it out. I have a very simple php script that sends a test email to myself. When I...
11
2848
by: ColinWard | last post by:
Hi. I have the following code in a module which sends email via Outlook. Option Compare Database Option Explicit ' Declare module level variables Dim mOutlookApp As Outlook.Application Dim mNameSpace As Outlook.NameSpace Dim mFolder As mapiFolder Dim mItem As MailItem
0
944
by: James | last post by:
We're attempting to migrate a distributed app from our current Windows 2000 setup to new hardware running Windows Server 2003 SP1. Everything is working great with the exception of any piece of logic attempting to use System.Web.Mail. The error I'm getting is "The transport failed to connect to the server". After many hours of scouring the...
6
2272
by: sellam | last post by:
I just installed to a new server and am trying to iron out certain bugs. Right now I have a problem with the mail function. I always get a FALSE return value when I call the mail function. This same code was working on my old server. I've done research and spent hours trying to figure out why it won't work to no avail. Here's what I...
4
6099
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 strbody=strbody +"dear customer,\n"; strbody=strbody +"we are glad to see ur response\n"; strbody=strbody +"we will make the needful thing as early...
5
14226
by: bilal | last post by:
I have installed PHP , Apache on WinXP . I am using php mail function but i am getting error i also have installed Argosoft mail server and it is running properly using port 25 and php.ini is also configured properly. But i m getting error Warning: mail() : Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and...
7
2611
by: r0g | last post by:
I'd like PHP to send mail to a local mailserver running at localhost:25 like I used to on windows. This mailserver is a dummy server which just writes the mail to disk for unit testing and works fine when I use thunderbird to send mail to it and used to work fine under windows however... It doesn't work under Ubuntu. Looking at my php.ini...
0
7612
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7922
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8119
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7668
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7964
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5218
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3637
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2111
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.