f



mail() function doesn't seem to be sending MAIL FROM: properly

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 my own
domain. This makes my think that the From: address is somehow not
getting sent to my server properly or that I'm pointing at the wrong
server.

The confounding thing is that it was working for a while and I don't
think I changed anything and it just stopped.

I'm running these PHP pages for a client off of one of those cheap
hosting services, I think it's called 1dollarhost.com or something,
although I can't remember at the moment.

Has anyone else had trouble with this or found a solution?

Many thanks,
Todd

0
6/27/2005 10:16:11 PM
comp.lang.php 32646 articles. 0 followers. Post Follow

1 Replies
683 Views

Similar Articles

[PageSpeed] 41

tzuccolo2001@yahoo.com wrote:
> 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 my own
> domain. This makes my think that the From: address is somehow not
> getting sent to my server properly or that I'm pointing at the wrong
> server.
> 
> The confounding thing is that it was working for a while and I don't
> think I changed anything and it just stopped.
> 
> I'm running these PHP pages for a client off of one of those cheap
> hosting services, I think it's called 1dollarhost.com or something,
> although I can't remember at the moment.
> 
> Has anyone else had trouble with this or found a solution?
> 
> Many thanks,
> Todd
> 

Todd,

Your hosting service probably requires authentication to send mail. 
Otherwise they'd be open relays for spammers - just put your email 
address in the From: field and send away.

One way is to run a mail server on your test machine - but ensure you 
have port 25 firewalled or you will become an open relay.

A better way is to use PHPMailer which will do SMTP authentication.

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
0
jstucklex (14659)
6/28/2005 12:05:29 AM
Reply:

Similar Artilces:

Mail merge doesn't mail and/or doesn't merge
Mail merge doesn't mail and/or doesn't merge With me at least it doesn't. We are getting too many false positives on our bcc-mailing lists, so I decided to give the mail merge feature in PM 4.41 a go. The goal was to simultaneously send messages addressed to multiple recipients. I made a csv file containing nine of my own addresses in a column called ~kemail~, made this the data file, checked the box for the first field to be the fieldname and sent the email with the string ~kemail~ in the address box. I also attached a pdf file. PM reported a successful transaction, b...

newbie question: sendmail doesn't send mail to external mail account.
Hi there, It seems send mail doesn't send mail to external mail account in my FreeBSD 4.8 BOX. However, I'm able to receive mail from external mail, such as yahoo, hotmail account. My config is: FreeBSD 4.8 ISP: bell Sympatico high speed with dynamic IP address. SMTP port is enabled on the router/firewall. Can anyone help? bluesnow#mail -v calvin2k_cn@yahoo.com Subject: This is a test. Do you hear me? EOT calvin2k_cn@yahoo.com... Connecting to [127.0.0.1] via relay... 220 bluesnow.gotdns.com ESMTP Sendmail 8.12.8p1/8.12.8; Thu, 26 Jun 2003 17:14:51 -0400 (EDT) >>> EHLO bluesnow.gotdns.com 250-bluesnow.gotdns.com Hello localhost [127.0.0.1], pleased to meet you 250-ENHANCEDSTATUSCODES 250-PIPELINING 250-8BITMIME 250-SIZE 250-DSN 250-ETRN 250-DELIVERBY 250 HELP >>> MAIL From:<cguan@bluesnow.gotdns.com> SIZE=68 250 2.1.0 <cguan@bluesnow.gotdns.com>... Sender ok >>> RCPT To:<calvin2k_cn@yahoo.com> >>> DATA 250 2.1.5 <calvin2k_cn@yahoo.com>... Recipient ok 354 Enter mail, end with "." on a line by itself >>> . 250 2.0.0 h5QLEpDJ006984 Message accepted for delivery calvin2k_cn@yahoo.com... Sent (h5QLEpDJ006984 Message accepted for delivery) Closing connection to [127.0.0.1] >>> QUIT 221 2.0.0 bluesnow.gotdns.com closing connection bluesnow# sendmail -bp /var/spool/mqueue (2 requests) -----Q-ID----- --Size-- -----Q-Time----...

PHP mail() function failing to send mail
Hi everyone, Our setup: PHP 4.3.11, FreeBSD 5.3 RELEASE, Sendmail 8.1, 1 host environment, 2 jails. Our problem: While we can send email from the command line just fine in one of the jails, we cannot use the php mail() command to send email using sendmail at all. The function, when executed, does absolutely nothing. No error, no reports to the maillog, nothing. I've read somewhere that it's "not possible" to send mail using the php mail() function within a freebsd jail, but i'm nearly certain we have it working this way on another server, but can't seem to figure out the issue. Anyone know any tests we can do to learn more? Thanks. Check out the log messages from your sendmail... If it's not logging anything, try increasing (temporarily) the log level (24 should be more than enough) Probability says that you're running into a permission issue with sendmail. Probably your PHP/Apache user is not allowed to relay email. I'm not sure this might apply since I am not familiar to BSD, but, had similar problems with a RH machine just a few days ago ...

can't send mail using mail()
hello, i am new to sending mail with php. the first function i tried is the mail(). when i passed the required parameters (to, message,subject), the apache error log said that the parameters are uninitialised. but the parameters already had value. do you know what is wrong? thank you fasisi wrote: > hello, > > i am new to sending mail with php. the first function i tried is the > mail(). when i passed the required parameters (to, message,subject), > the apache error log said that the parameters are uninitialised. but > the parameters already had value. > > do you know what is wrong? > > thank you Sorry, my crystal ball is broken. I can't see your code. Try posting your code so we can see what might be wrong. -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex@attglobal.net ================== On Mar 16, 8:14=A0pm, Jerry Stuckle <jstuck...@attglobal.net> wrote: > fasisi wrote: > > hello, > > > i am new to sending mail with php. the first function i tried is the > > mail(). when i passed the required parameters (to, message,subject), > > the apache error log said that the parameters are uninitialised. but > > the parameters already had value. > > > do you know what is wrong? > > > thank you > > Sorry, my crystal ball is broken. =A0I can't see your code. > > Try posting your code so we can s...

Why can't I send a mail with PHP
I can't send a mail with the following mail header: $headers = "MIME-Version: 1.0\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\n"; $headers .= "From: \"User\" &lt;user@inter.net&gt;\n"; Therefore $headers is set to (echo $header;) MIME-Version: 1.0 Content-type: text/html; charset=iso-8859-1 From: "User" <user@inter.net> The mail has not been delivered and my PHP server says: [24-Nov-2005 00:37:19] PHP Warning: mail() [<a href='function.mail'>function.mail</a>]: SMTP server response: 501 5.5.4 Invalid Address in C:\PHP\file.php on line 132 If I use $headers .= "From: user@inter.net\n"; instead of $headers .= "From: \"User\" &lt;user@inter.net&gt;\n"; is works perfect. What's wrong? Stefan Don't use &lt; and &gt;. Use the actual characters < and >. "Stefan Mueller" <seekware-remove-@yahoo.com> wrote in message news:dm30pb$1e9u$1@news.imp.ch... >I can't send a mail with the following mail header: > $headers = "MIME-Version: 1.0\n"; > $headers .= "Content-type: text/html; charset=iso-8859-1\n"; > $headers .= "From: \"User\" &lt;user@inter.net&gt;\n"; > > Therefore $headers is set to (echo $header;) > MIME-Version: 1.0 Content-type: text/html; charset=iso-8859-1 From: > "User" <use...

Sending mail doesn't work
I would like to switch to Gnus for my email needs, but sending mail doesn't seem to work. I get the messages in the mail group, and 'r'eply bring up the mail sending buffer. I can edit the mail normally, and pressing C-c C-c makes the mail buffer go away, kinda like succesfull send would do. However, the mail is apparently not sent out. How should I start debugging the thing? The computer is running rh8.0 and GNU emacs 21.2.1, and I'm not root on the machine. I use Pine normally, and there appears to be no smtp server configured, so I guess it uses 'sendmail' or someth...

Mail doesn't import Mail messages from another machine
Hi, My friend just got a new G5 (I'm jealous) and would like to import all the mail messages on his old G4 (he has moved them all to an external hard drive for safe keeping). We tried the Tiger Mail>Import scheme and imported from the external hard drive. The Import routine imported all his Mail folders but they're all empty. Is there a way to get this to work correctly? Any help appreciated. r. In article <rb28-E04B37.13013529092005@corp.supernews.com>, "RobertB." <rb28@nyu.edu> wrote: > Hi, > > My friend just got a new G5 (I'm jeal...

density function (I wanted to add an attachment- but couldn't figure out how, can I send a post to the group's mail address? what is is?)
Hi all, I'm trying to plot the density function of several variables in my data set. I found a macro which I dont understand completely, and I tried to use it. 1- Can I count on the density out file that it's the density function (when i plot it with G Plot at the end)? 2- The grap I get is very small comparing to the window. I tried to change the window parametter ,but it didn't help. I also get Black lines that I don't need- how do i get rid of them? /*-------------------------------------------------------------------* * Name: density.sas * * Title: Nonparametric density ...

Junk mail box doesn't open automatically, I miss mails because of this
When I get a junk message, Eudora puts it in the junk mail box, but doesn't open the mail box. With other filters, it does open the box automatically. This way I know a mail came in. I would also like Eudora to open my Junk mail box, so I know a mail got in there. Anybody have some advice? Eudora 7 paid mode chieleman On Mon, 15 Jan 2007 14:13:21 +0100, chieleman <vlaflip31-nieuwsgroepREMOVETHIS@REMOVETHISyahoo.com> wrote: >When I get a junk message, Eudora puts it in the junk mail box, but >doesn't open the mail box. With other filters, it does open t...

Can't send mail using Mail.app, but can with Thunderbird
Hello, I am having one heck of a time, and it's killing me. I am new to the world of OS X but am adapting well, with one exception - Mail. Here's the deal. Using Thunderbird, I can send mail out with password authentication. I can send it via port 25 normally or via port 465 via SSL. I can also telnet to port 25 and see the standard email connection, and I can even fake it out using the proper sequence of commands. I can telnet to port 465, although since that's SSL I can't easily fake key negotiation or anything like that - but, it does establish a connection. However, Mai...

mozilla successfully sends mail, but then doesn't?
I have Mozilla mail reader 1.6 on linux, and it was working until recently. Now when I send mail via SMTP, the progress dialog appears, it says...delivering mail...mail sent successfully...the dialog hangs at this point. Then an error dialog appears and says: ---------------------------------------------------------------------- Sending of message failed The message could not be sent because connecting to SMTP server mail.pacbell.net failed. The server may be unavailable or is refusing connections. Please verify that your SMTP server setting is correct and try again, or else contact your ...

Apple Mail; mail doesn't get to server to be "saved"
I'm still one of those increasingly few AOL users (got kids). Have had the account since '95. Anyway, when I got cable access at work, I decided to use my Mac Mini in the office to not only access my work email, but also the AOL account which I use at home for personal stuff. Running Tiger 10.4.7 and Apple Mail on both systems (G4 at home). Things worked fine for months; I simply configured the Mail application to access my office mail server and also my AOL account, which is IMAP. I only use AOL at home. When I use Mail at work, I still get all of my normal AOL mail. I think that wha...

Subscription setting 'No e-mail': Doesn't work !
Hi all, I switched my subscription setting to "No e-mail" but I still receive an e-mail everyday. Does one know how I could reach the google technical support ? Thanks! Catherine. ...

kmail doesn't even try to send smtp mail
imap connection for browsing and loading messages works fine.. but an ethereal cap doesn't even show a single attempt at an smtp call. but when i use the "configure kmail" -> "network" -> modifying outgoing accounts -> "security" tab -> "check what server supports" button for login/authentication option.. it interacts with server normally (and i can appearantly post to newsgroups normally too!?) ...

when receiving the mail(php mail function), the variable's last value is getting converted to $ or # replacing the digit
Below is my code: But when I receive the mail, I don't get the last two digits in the $post_url. I tried displaying the same message on the page and it displayes $post_url properly. But when I receive the mail, I get the value of $post_url as www.32minutesforum.com/post_clicked.php?id$. where as I should get www.32minutesforum.com/post_clicked.php?id<some number>. i.e. www.32minutesforum.com/post_clicked.php?id15 Please help! File: <?php include 'connect.php'; include 'header.php'; echo '<div class="holder_content">'; echo '<section class="group_text">'; echo 'Posted successfully. Check your post <a href="'.$_SESSION['reply_post_id'].'">HERE</a>'; $post_url = $_SESSION['reply_post_id']; $to= $_SESSION['post_email']; $subject="You just got a reply for your post in 32minutesforum.com"; $message=' <html> <head> <title>32 Minutes Forum</title> </head> <body> <p>You got a reply for your post title: '. $_SESSION['post_title'].'.</p> <p>Check your post in:<br/>www.32minutesforum.com/'.$post_url.'.</p> <p>Thanks for using 32minutesforum.com.<br/> Thank you,<br/> 32minutesforum.com Team.</p> </body> </html>'; ...

php mail() not sending to mail Clients (ie, Outlook, Apple Mail, thunderbird, etc..)
I have a send mail script on my site that. The emails are recieved by gmail, and yahoo, but not to mail clients like Outlook, Mail, etc...) Is this a problem with the script, or is it something I must change in php ini file? Thanks in advance for any help. here is the code. (im using it in conjunction with javascript for some AJAX stuff) if(!isset($_GET['action'])) { die("You must not access this page directly!"); //Just to stop people from visiting contact.php normally } /* Now lets trim up the input before sending it */ $name = trim($_GET['name']); //The senders name $to = trim($_GET['maily']); //The senders email address $place = trim($_GET['place']); //The senders email address $subject = "you have recieved mail"; $headers = "From:$name"; $message = "{$name} deemed you worthy of receiving the following information/exchange from Trumpet.\n\n Follow This Link {$place}"; mail($to, $subject, $message,$headers); //a very simple send echo 'contactarea|<p class="sent">Article Sent!</p>'; //now lets update the "contactarea" div on the contact.html page. The contactarea| tell's the javascript which div to update. ?> shybe wrote: > I have a send mail script on my site that. > > The emails are recieved by gmail, and yahoo, but not to mail clients > like Outlook, Mail, etc...) > > Is this a problem with the script, or is it something ...

send mail button doesn't work vers 6.1.2
Eudora 6.1.2.0 My get mail button quit working, it pushes but nothing happens. I have to go to file then check mail or right click on the personality to get it to check mail. Any suggestions on a fix? Mine did that when I mistakenly unchecked the "check mail" box on all of my personalities' preferences. "anesthesia" <eudoragroup@klapperich.org> wrote in message news:k6udnTrYE_GzFujcRVn-rQ@bright.net... > Eudora 6.1.2.0 > My get mail button quit working, it pushes but nothing happens. I have to > go to file then check mail or right click on the personality to get it to > check mail. Any suggestions on a fix? > ...

wanadoo.fr's portal doesn't show Eudora's mails
Hello A strange problem when I write to a friend of mines. When she reads her mails with www.wanadoo.fr 's portal, everything composed with Eudora only gives a blank page (no problem when she uses... Eudora or Outlook or when I write with Outlook from my office - yes I know but they don't allow me to install Eudora...). Should I change something in the ini file? Don't understand what happens there, nor here. By the way : it's always interesting to read the Eudora forum Friendly regards, even when one doesn't have any problem with this program. Michel On Tue, 05 Oct 2004 16:52:49 +0200, Michel <michel_._bero@la_poste_net> wrote: >Hello > >A strange problem when I write to a friend of mines. When she reads >her mails with www.wanadoo.fr 's portal, everything composed with >Eudora only gives a blank page (no problem when she uses... Eudora or >Outlook or when I write with Outlook from my office - yes I know but >they don't allow me to install Eudora...). >Should I change something in the ini file? Don't understand what >happens there, nor here. >By the way : it's always interesting to read the Eudora forum >Friendly regards, even when one doesn't have any problem with this >program. Michel, does she have the same problem with mail from other Eudora users? groetjes, -- Ajo Wissink On Tue, 05 Oct 2004 16:52:49 +0200, Michel <michel_._bero@la_post...

Mail won't check mail
Ihad a difficulty yesterday, and after I recovered, I found that Mail won't check mail. I send an email from my .mac account to my earthlink account and mail will not retreive it. I checked my email using the web-email and found the mail there, and some mail from others. What could cause Mail to stop retreiving mail? How can I fix it? Thanks, AndyD In article <1grf1p0.1m0bixe1503zn4N%andyda@earthlink.net>, Andy Dannelley <andyda@earthlink.net> wrote: > Ihad a difficulty yesterday, and after I recovered, I found that Mail > won't check mail. > > I send an email from my .mac account to my earthlink account and mail > will not retreive it. > > I checked my email using the web-email and found the mail there, and > some mail from others. > > What could cause Mail to stop retreiving mail? > > How can I fix it? Did you try repairing permissions? Did you check your Account settings, including advanced, to make sure that nothing was changed? Cathy -- "there's a dance or two in the old dame yet." - mehitabel C.Stevenson, M.D. cats1921@invalidsonic.net Cathy Stevenson <cats1921@invalidsonic.net> wrote: > In article <1grf1p0.1m0bixe1503zn4N%andyda@earthlink.net>, Andy > Dannelley <andyda@earthlink.net> wrote: > > > Ihad a difficulty yesterday, and after I recovered, I found that Mail > > won't check mail. > > > > I send an email from my .mac...

i am getting error while sending mail using mail() function
i am getting following error. Warning: mail() [function.mail]: Failed to connect to mailserver at "smtp.gmail.com" port 465, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in D:\LUGUBA\root\site\temp5.php on line 8 i have done the following (1) in php.ini file SMTP = smtp.gmail.com smtp_port = 465 sendmail_from = kathlal.panjabi@gmail.com (2) i am sendig mail using mail() function and i am passing only defaulst arguments to,subject,body is it enough to send a mail or something is missing?? and do not i need to give password of my above email address kathlal.panjabi@gmail.com thxs for help in advance....... vishal wrote: > i am getting following error. > > Warning: mail() [function.mail]: Failed to connect to mailserver at > "smtp.gmail.com" port 465, verify your "SMTP" and "smtp_port" setting > in php.ini or use ini_set() in D:\LUGUBA\root\site\temp5.php on line 8 > I think it's very nlikely that Gmail will allow relaying, although you should be able to send to your own account. Port 465 is for SMPTS (i.e. SSL wrapped SMTP) C. *** vishal wrote/escribi� (6 Apr 2005 02:35:56 -0700): > SMTP = smtp.gmail.com > smtp_port = 465 > sendmail_from = kathlal.panjabi@gmail.com Gmail's SMTP server only allows encrypted connections; it also requires a username and password. I don't think that mail() function can do such a job. You should find a diffe...

Mail will not send mail but will receive mail
At work I have a Wallstreet with Jaguar connected to a DSL line. Up until a couple days ago I have been able to use my personal ISP smtp address to send and receive mail. This is not the same company as the DSL provider. A couple days ago I was able to receive posts but not send them. I tried repairing permissions, and trashing the Mail prefs. Finally I emailed my ISP and the response was that I have to use the DSL carrier's smtp address. Yet, I've been using my personal ISP's smtp address for about a year. At home I use a dialup with the ISP and everything works fi...

Some mail goes and some doesn't
Here is a weird one. I just installed Eudora 6.1 on windows 98 and it is working but when sending emails, some get hung up. It seems like it is the emails that have been editted before sending. For instance, if I just type out a message. I can send it just fine, but if I copy text into a message and edit it before sending, it usually will get hung up. My work around so far is to avoid editting text at all costs, but it is very inconvenient. Suggestions would be welcome. Peace, Ray Ray Greenberg <ray@yogalifestyle.com> wrote: > Here is a weird one. I just installed Eudora 6.1 on windows 98 and it is > working but when sending emails, some get hung up. It seems like it is the > emails that have been editted before sending. > For instance, if I just type out a message. I can send it just fine, > but if I copy text into a message and edit it before sending, it usually > will get hung up. At what stage do they get hung up? Is it when you click on the "send" button after composing them? There's a bug in Eudora that causes some messages to refuse to save to the outbox. As far as I can tell, it happens when the same message has already been saved repeatedly. (Either by the user or by having the option to auto-save messages while composing turned on.) This problem isn't new in 6.1, but I think it may happen more often. -- Katrina ...

Can't Send Mail
I know there have been a number of threads recently on the above subject, but none of them seems to apply to my case. I'm running OS X 10.4.11 and Eudora 6.2.4 on a G4. What is somewhat unusual is that my DSL provider, AT&T, is not my ISP. (I'll supply the history of that if necessary, but I think it's irrelevant.) Using Eudora has been uneventful until recently, when AT&T made some changes designed to cut down on outgoing spam. They added SSL password authentication for sending messages and sending through a special port. In addition, if I wa...

can't send a mail
Dear all, I don't know where my problem is. Hopefully someone can give me some hint to explore the problem more. I am running Apache 2.0.48 wih PHP 4.3.4. The apache is running as nobody. I want to use the mail() to send out the email from a web page but it can't work. The web server is on the red hat linux 9.0 with rpm sendmail-8.12.8-9.90 and sendmail-cf. In the begining, I got the error message, 'SYSERR(nobody) can not write to queue directory /var/spool/clientmqueue/ when I use the mail(). I kind of make some progress if not worse to follow the sendmail/SECURITY. I...

Web resources about - mail() function doesn't seem to be sending MAIL FROM: properly - comp.lang.php

Resources last updated: 3/24/2016 1:24:16 AM