php


Email sent using IMAP not reflected in the inbox of the receiver


This is the code:
<?php
$to = "to_address#gmail.com";
$subject = "Subject";
$body = "Hello";
$headers = "From: from_address#gmail.com\r\n".
"Reply-To: from_address#gmail.com\r\n";
$cc = null;
$bcc = null;
$return_path = "from_address#gmail.com";
$a = imap_mail('$to', '$subject', '$body', '$headers', '$cc', '$bcc',
'$return_path');
echo "Email sent!<br />";
$mbox = imap_open("{imap.gmail.com:993/imap/ssl}", "from_address#gmail.com",
"password");
imap_append($mbox, "{imap.gmail.com:993/imap/ssl}[Gmail]/Sent Mail",
"From: from_address#gmail.com\r\n".
"To: ".$to."\r\n".
"Subject: ".$subject."\r\n".
"Date: ".date("r", strtotime("now"))."\r\n".
"\r\n".
$body.
"\r\n"
);
echo "Message saved to Send folder!<br />";
imap_close($mbox);
?>
Email sent is reflected in the Sent Mail of sender, but not in the Inbox of receiver. What might be the problem?

Related Links

Download a folder in PHP
Adding php code to .html file
Magento Subtotal and grand Total is Empty in Cart Page
Getting error for db query when nginx and db on different servers? “PHP message: Database transaction aborted automatically in”
My Syntax is correct or not
How to add terms and condition checkbox in Yii user module?
How can I sent a variable from a controller to a view in Laravel?
PHP unique numbers not unique
Connecting to database with PDO in php
symfony2 ajax select without transformers and custom query builder
Understanding Traits vs Composition in PHP
ImageMagick crashing for JPEG with incorrect density value
Get $_FILES from curl without HTML form
Wordpress: Search items in table
Crontab not running PHP scripts properly
Adding active class to first item in wordpress loop

Categories

HOME
openshift
knockout.js
tomcat
swi-prolog
semantic-web
tabs
angular2-template
tup
live-streaming
asp.net-core-1.0
async-await
jitsi
yii2-basic-app
unity-container
backtracking
liferay-6.2
batch-rename
websphere-portal
strophe.js
android-cardview
ccavenue
react-bootstrap-table
php-5.3
amazon-cloudtrail
basic-authentication
tilemill
intune
numerics
code-rally
twilio-php
aurelia-cli
django-smart-selects
right-click
slideshow
plane
resampling
classnotfoundexception
yoast
windows-media-player
tinyioc
roracle
uiautomatorviewer
cordova-ios
spring.net
google-news
scala-collections
pen
gnome-terminal
dex
sidewaffle
prefetch
wildfly-9
gawk
cocoa-bindings
livecycle
msbuild-4.0
gnucash
currency-exchange-rates
openmrs
ioexception
boost-proto
openshift-cartridge
dnx50
pythonxy
knife
jnlp
postal-code
modern.ie
physicsjs
azure-xplat-cli
scala-swing
tidyr
operands
relationships
mfmessagecomposeview
two.js
jack
cpu-time
typesafe-stack
django-settings
coalesce
pacman
xs
background-thread
2d-vector
idispatch
clrprofiler
border-box
flymake
glassfish-esb
representation
fork-join
kernel32
fragment-identifier
hungarian-notation
pinax
firephp
eai
tacit-programming
twitter-feed
datagridcolumn
activex-exe

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile