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 -
<?php
-
require_once("connect.php");
-
-
// value sent from form
-
$email_to=$_POST['email_to'];
-
-
// table name
-
$tbl_name=members;
-
-
// retrieve password from table where e-mail = $email_to(mark@phpeasystep.com)
-
$sql="SELECT password FROM $tbl_name WHERE email='$email_to'";
-
$result=mysql_query($sql);
-
-
// if found this e-mail address, row must be 1 row
-
// keep value in variable name "$count"
-
$count=mysql_num_rows($result);
-
-
// compare if $count =1 row
-
if($count==1){
-
-
$rows=mysql_fetch_array($result);
-
-
// keep password in $your_password
-
$your_password=$rows['password'];
-
-
// ---------------- SEND MAIL FORM ----------------
-
-
// send e-mail to ...
-
$to=$email_to;
-
-
// Your subject
-
$subject="Your password here";
-
-
// From
-
$header="from: your name <your email>";
-
-
// Your message
-
$messages= "Your password for login to our website \r\n";
-
$messages.="Your password is $your_password \r\n";
-
$messages.="more message... \r\n";
-
-
// send email
-
$sentmail = mail($to,$subject,$messages,$header);
-
-
}
-
-
// else if $count not equal 1
-
else {
-
echo "Not found your email in our database";
-
}
-
-
// if your email succesfully sent
-
if($sentmail){
-
echo "Your Password Has Been Sent To Your Email Address.";
-
}
-
else {
-
echo "Cannot send password to your e-mail address";
-
}
-
-
?>
-
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
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)
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
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.
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 -
<?php
-
include("Mail.php");
-
/* mail setup recipients, subject etc */
-
$recipients = "feedback@yourdot.com";
-
$headers["From"] = "user@somewhere.com";
-
$headers["To"] = "feedback@yourdot.com";
-
$headers["Subject"] = "User feedback";
-
$mailmsg = "Hello, This is a test.";
-
/* SMTP server name, port, user/passwd */
-
$smtpinfo["host"] = "smtp.mycorp.com";
-
$smtpinfo["port"] = "25";
-
$smtpinfo["auth"] = true;
-
$smtpinfo["username"] = "smtpusername";
-
$smtpinfo["password"] = "smtpPassword";
-
/* Create the mail object using the Mail::factory method */
-
$mail_object =& Mail::factory("smtp", $smtpinfo);
-
/* Ok send mail */
-
$mail_object->send($recipients, $headers, $mailmsg);
-
Sign in to post your reply or Sign up for a free account.
Similar topics |
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:
|
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:
"
|
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";
|
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...
|
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
| |
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:
|
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")
|
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
|
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
|
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...
|
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,...
| |
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...
|
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...
|
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...
|
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
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...
| |