473,774 Members | 2,253 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

message sent to mail go to spam mail

123 New Member
the code below is my mail code its working but message sent to the email is going to the spam mail not the inbox how can make the message go to indox

Expand|Select|Wrap|Line Numbers
  1. <?php
  2. require_once("connect.php");
  3.  
  4. // value sent from form
  5. $email_to=$_POST['email_to'];
  6.  
  7. // table name
  8. $tbl_name=members;
  9.  
  10. // retrieve password from table where e-mail = $email_to(mark@phpeasystep.com)
  11. $sql="SELECT password FROM $tbl_name WHERE email='$email_to'";
  12. $result=mysql_query($sql);
  13.  
  14. // if found this e-mail address, row must be 1 row
  15. // keep value in variable name "$count"
  16. $count=mysql_num_rows($result);
  17.  
  18. // compare if $count =1 row
  19. if($count==1){
  20.  
  21. $rows=mysql_fetch_array($result);
  22.  
  23. // keep password in $your_password
  24. $your_password=$rows['password'];
  25.  
  26. // ---------------- SEND MAIL FORM ----------------
  27.  
  28. // send e-mail to ...
  29. $to=$email_to;
  30.  
  31. // Your subject
  32. $subject="Your password here";
  33.  
  34. // From
  35. $header="from: your name <your email>";
  36.  
  37. // Your message
  38. $messages= "Your password for login to our website \r\n";
  39. $messages.="Your password is $your_password \r\n";
  40. $messages.="more message... \r\n";
  41.  
  42. // send email
  43. $sentmail = mail($to,$subject,$messages,$header);
  44.  
  45. }
  46.  
  47. // else if $count not equal 1
  48. else {
  49. echo "Not found your email in our database";
  50. }
  51.  
  52. // if your email succesfully sent
  53. if($sentmail){
  54. echo "Your Password Has Been Sent To Your Email Address.";
  55. }
  56. else {
  57. echo "Cannot send password to your e-mail address";
  58. }
  59.  
  60. ?>
  61.  
Aug 27 '09 #1
6 4201
dlite922
1,584 Recognized Expert Top Contributor
I don't even need to look at your code. This is not a code problem. It is beyond your control, to a certain point.

If you domain is new, and doesn't have an SPF record, add one now (ask your provider, google it).
2. Make sure you have a valid "FROM" record. Most likely If this field is empty you won't even see it in any folder, mailservers automatically reject it.

Ask the mail service (yahoo, hotmail, aol, the company) to put you on the white list.

It will take some time and patience. Until then, avoid putting any images or HTML in the events.



Dan
Aug 27 '09 #2
hsriat
1,654 Recognized Expert Top Contributor
Verify that the MX and A records of your domain DNS configuration are set to the IP of the server from whom you are sending the mail.
(SPF - as Dan said)
Aug 31 '09 #3
simon2x1
123 New Member
please can you explain further or i you saying i should add my smtp setting to the mail function if so how can i do that can give me an example
Sep 14 '09 #4
labmonkey111
44 New Member
Including the X-Mailer and Message-ID headers can also help in avoiding getting tagged as spam. I had the same problem, drove me nuts until I figured this out.
Sep 14 '09 #5
zorgi
431 Recognized Expert Contributor
Or you can simply use PHPMailer and forget about how its done. I used it in the past and am very pleased with results. :

http://phpmailer.worxware.com/index.php
Sep 16 '09 #6
simon2x1
123 New Member
the code below was a code give to me to solve me to stop my mail from going in to spam but i have a problem with line 16 how can i fix and what should i do i will appreciate if u will edit the problem on the code below

Expand|Select|Wrap|Line Numbers
  1. <?php
  2. include("Mail.php");
  3. /* mail setup recipients, subject etc */
  4. $recipients = "feedback@yourdot.com";
  5. $headers["From"] = "user@somewhere.com";
  6. $headers["To"] = "feedback@yourdot.com";
  7. $headers["Subject"] = "User feedback";
  8. $mailmsg = "Hello, This is a test.";
  9. /* SMTP server name, port, user/passwd */
  10. $smtpinfo["host"] = "smtp.mycorp.com";
  11. $smtpinfo["port"] = "25";
  12. $smtpinfo["auth"] = true;
  13. $smtpinfo["username"] = "smtpusername";
  14. $smtpinfo["password"] = "smtpPassword";
  15. /* Create the mail object using the Mail::factory method */
  16. $mail_object =& Mail::factory("smtp", $smtpinfo);
  17. /* Ok send mail */
  18. $mail_object->send($recipients, $headers, $mailmsg);
  19.  
Oct 31 '09 #7

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

Similar topics

5
2543
by: Philip Ronan | last post by:
OK, here's my 2p worth: === Q. Why am I getting the error message 'Headers already sent'? A. PHP produces this error message when you try to set a header for a web page after you have already started sending out the content of the page. Web content is always delivered with a few headers at the top, ending with a blank line. For example, a web page might start like this:
2
91073
by: Janna Deegan | last post by:
Hello all, First off, if there is a better place to post for an answer to this question, please feel free to point me there. I have some very strange behavior happening with my System.web.mail objects. I was able to run my application fine for roughly 1500 email messages. The next time I tried sending mail, it stopped working with the message: "
10
5516
by: ahager via DotNetMonster.com | last post by:
I am receiving this messaage in a console application I wrote, I am authenticating, and my network admin swears their is nothing wrong with the smtp server. Any ideas? public void Mail_update() { try { System.Web.Mail.MailMessage TME = new MailMessage(); TME.To = "adam_james98@hotmail.com";
3
9256
by: Jens | last post by:
Hi I am writing a ASP.NET web application that must sent some e-mails. I get the exception “Could not access 'CDO.Message' object” when I call SmtpMail.Send. This only happens when I send e-mail addresses out side my company walls. When the e-mail is send on some one in my company it works perfect. I think it is a relay issue. Our system administrator will not allow relaying. In the ASP.Net web.config file I let the web application...
2
604
by: Martin | last post by:
Hi, I have standard code that sends mail from an asp.net application. The application is running on a production web server. it uses the standard system.web.mail namespace. most of the time mail is sent fine. however every so often an error is reported where mail can't be sent. upon more closer inspection I find that the line that tries to send mail is throwing an error and the error generated is
4
3700
by: chris.huh | last post by:
This may not be the best place to put this but i have set up apache as a testing server on my local machine. Whenever i try to use a formmail.php script i downloaded is always come sup saying that i need to configure sendmail_from. I have changed this (in php.ini) to be to my email address and the smtp server is set to be my university's smtp server (which i hope should work). But it still comes up with the error. The actual error is:
16
3150
by: whyyyy | last post by:
The script below works fine if the form is filled out and submitted. But a (blank) e-mail is sent whenever the page loads, even when the form is not submitted. I would like to receive the e-mail only when the form is submitted <%@LANGUAGE="VBSCRIPT"%> <% Set MyMail=CreateObject("CDO.Message")
0
3809
by: Mail Delivery System | last post by:
--foo-mani-padme-hum-2391-1-1176705911 Content-Type: text/plain This message was created automatically by mail delivery software. A message that you sent could not be delivered to one or more of its recipients. This is a permanent error. The following address(es) failed: giles@localhost SMTP error: 550 X-Spam_score: 9.0
2
1290
by: =?Utf-8?B?c2Ft?= | last post by:
I use Outlook express 6 and run Macafee virus protection. When I check my email I have hundreds of replies telling me my sent messages were blocked by spam blockers or the recip address is not valid. I did not sent these emails but they show my address as the sender. I have changed my password and have run my virus scan numerous times and it shows no virus or spyware found. Any idea how I can stop this Thanks -- sam
0
9621
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
9454
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10264
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10106
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8937
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7463
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5355
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5484
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2852
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.