From windows system mails is sending fine but after hosting into centos mail is sending in encrypted format
up vote
0
down vote
favorite
From windows system(locally) it is working fine but after hosting into centos mail is sending in encrypted format. Following code i'm using to send mails.
$boundary = md5("sanwebe");
$headers = "MIME-Version: 1.0rn";
$headers .= "From:".$from_email."rn";
$headers .= "Reply-To: ".$from_email."" . "rn";
$headers .= "CC: ".$cc."" . "rn";
$headers .= "Content-Type: multipart/mixed; boundary = $boundaryrnrn";
$body = "--$boundaryrn";
$body .= "Content-Type: text/html; charset=ISO-8859-1rn";
$body .= "Content-Transfer-Encoding: base64rnrn";
$body .= chunk_split(base64_encode($message));
//attachment
if (file_exists($file_name)){
$body .= "--$boundaryrn";
$body .="Content-Type: $file_type; name=".$file_name."rn";
$body .="Content-Disposition: attachment; filename=".$file_name."rn";
$body .="Content-Transfer-Encoding: base64rn";
$body .="X-Attachment-Id: ".rand(1000,99999)."rnrn";
$body .= $encoded_content;
}
$sentMail = @mail($recipient_email, $subject, $body, $headers);
Ouput Mail is:
8de2a431c506316063ec3a4044192e46
PGh0bWw+PGJvZHk+PHN0cm9uZz5EZWFyIFNpci9NYWRhbSw8L3N0cm9uZz4gPGJyIC8+DQo8YnIg
Lz4NCgkJIEluc3RydW1lbnQgOiBHQy8wMiwgc2VyaWFsX251bWJlciA6IEMxMjA5NTMwMjQ2Nywg
bWFrZSA6U2hpbWFkenUgIG1vZGVsIDpHQyAyMDEwIFBsdXMtIEluc3RydW1lbnQgaXMgYnJlYWtk
b3duIFBsZWFzZSBhbGxvdCBzZXJ2aWNlIFBlcnNvbiA8YnIgLz4NCjxiciAvPg0KQmVzdCBSZWdh
cmRzPGJyIC8+DQpBZG1pbiw8YnIgLz4NCiAgQWRtaW4sPGJyIC8+DQpWaW10YSBMYWJzIExpbWl0
ZWQuPC9ib2R5PjwvaHRtbD4=
php centos sendmail
New contributor
add a comment |
up vote
0
down vote
favorite
From windows system(locally) it is working fine but after hosting into centos mail is sending in encrypted format. Following code i'm using to send mails.
$boundary = md5("sanwebe");
$headers = "MIME-Version: 1.0rn";
$headers .= "From:".$from_email."rn";
$headers .= "Reply-To: ".$from_email."" . "rn";
$headers .= "CC: ".$cc."" . "rn";
$headers .= "Content-Type: multipart/mixed; boundary = $boundaryrnrn";
$body = "--$boundaryrn";
$body .= "Content-Type: text/html; charset=ISO-8859-1rn";
$body .= "Content-Transfer-Encoding: base64rnrn";
$body .= chunk_split(base64_encode($message));
//attachment
if (file_exists($file_name)){
$body .= "--$boundaryrn";
$body .="Content-Type: $file_type; name=".$file_name."rn";
$body .="Content-Disposition: attachment; filename=".$file_name."rn";
$body .="Content-Transfer-Encoding: base64rn";
$body .="X-Attachment-Id: ".rand(1000,99999)."rnrn";
$body .= $encoded_content;
}
$sentMail = @mail($recipient_email, $subject, $body, $headers);
Ouput Mail is:
8de2a431c506316063ec3a4044192e46
PGh0bWw+PGJvZHk+PHN0cm9uZz5EZWFyIFNpci9NYWRhbSw8L3N0cm9uZz4gPGJyIC8+DQo8YnIg
Lz4NCgkJIEluc3RydW1lbnQgOiBHQy8wMiwgc2VyaWFsX251bWJlciA6IEMxMjA5NTMwMjQ2Nywg
bWFrZSA6U2hpbWFkenUgIG1vZGVsIDpHQyAyMDEwIFBsdXMtIEluc3RydW1lbnQgaXMgYnJlYWtk
b3duIFBsZWFzZSBhbGxvdCBzZXJ2aWNlIFBlcnNvbiA8YnIgLz4NCjxiciAvPg0KQmVzdCBSZWdh
cmRzPGJyIC8+DQpBZG1pbiw8YnIgLz4NCiAgQWRtaW4sPGJyIC8+DQpWaW10YSBMYWJzIExpbWl0
ZWQuPC9ib2R5PjwvaHRtbD4=
php centos sendmail
New contributor
Please add the actual code of the email message you receive to the question, that probably is invalid so needs to be checked.
– arkascha
Nov 21 at 7:34
Above mentioned code is the actual code and getting encrypted format message to receivers side. if I add any attachment to mail that attachment is also encrypting.
– Ravindra
Nov 21 at 7:41
That does not look like something "encrypted", more like base64 encoding. But more important: that certainly is not the message code. That might be what you see in some email program, but that is something different. To understand what is wrong with your message you need to debug the code you send out, that is why I asked for it. Most email programs offer some feature like "View source code" or similar for received messages.
– arkascha
Nov 21 at 7:58
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
From windows system(locally) it is working fine but after hosting into centos mail is sending in encrypted format. Following code i'm using to send mails.
$boundary = md5("sanwebe");
$headers = "MIME-Version: 1.0rn";
$headers .= "From:".$from_email."rn";
$headers .= "Reply-To: ".$from_email."" . "rn";
$headers .= "CC: ".$cc."" . "rn";
$headers .= "Content-Type: multipart/mixed; boundary = $boundaryrnrn";
$body = "--$boundaryrn";
$body .= "Content-Type: text/html; charset=ISO-8859-1rn";
$body .= "Content-Transfer-Encoding: base64rnrn";
$body .= chunk_split(base64_encode($message));
//attachment
if (file_exists($file_name)){
$body .= "--$boundaryrn";
$body .="Content-Type: $file_type; name=".$file_name."rn";
$body .="Content-Disposition: attachment; filename=".$file_name."rn";
$body .="Content-Transfer-Encoding: base64rn";
$body .="X-Attachment-Id: ".rand(1000,99999)."rnrn";
$body .= $encoded_content;
}
$sentMail = @mail($recipient_email, $subject, $body, $headers);
Ouput Mail is:
8de2a431c506316063ec3a4044192e46
PGh0bWw+PGJvZHk+PHN0cm9uZz5EZWFyIFNpci9NYWRhbSw8L3N0cm9uZz4gPGJyIC8+DQo8YnIg
Lz4NCgkJIEluc3RydW1lbnQgOiBHQy8wMiwgc2VyaWFsX251bWJlciA6IEMxMjA5NTMwMjQ2Nywg
bWFrZSA6U2hpbWFkenUgIG1vZGVsIDpHQyAyMDEwIFBsdXMtIEluc3RydW1lbnQgaXMgYnJlYWtk
b3duIFBsZWFzZSBhbGxvdCBzZXJ2aWNlIFBlcnNvbiA8YnIgLz4NCjxiciAvPg0KQmVzdCBSZWdh
cmRzPGJyIC8+DQpBZG1pbiw8YnIgLz4NCiAgQWRtaW4sPGJyIC8+DQpWaW10YSBMYWJzIExpbWl0
ZWQuPC9ib2R5PjwvaHRtbD4=
php centos sendmail
New contributor
From windows system(locally) it is working fine but after hosting into centos mail is sending in encrypted format. Following code i'm using to send mails.
$boundary = md5("sanwebe");
$headers = "MIME-Version: 1.0rn";
$headers .= "From:".$from_email."rn";
$headers .= "Reply-To: ".$from_email."" . "rn";
$headers .= "CC: ".$cc."" . "rn";
$headers .= "Content-Type: multipart/mixed; boundary = $boundaryrnrn";
$body = "--$boundaryrn";
$body .= "Content-Type: text/html; charset=ISO-8859-1rn";
$body .= "Content-Transfer-Encoding: base64rnrn";
$body .= chunk_split(base64_encode($message));
//attachment
if (file_exists($file_name)){
$body .= "--$boundaryrn";
$body .="Content-Type: $file_type; name=".$file_name."rn";
$body .="Content-Disposition: attachment; filename=".$file_name."rn";
$body .="Content-Transfer-Encoding: base64rn";
$body .="X-Attachment-Id: ".rand(1000,99999)."rnrn";
$body .= $encoded_content;
}
$sentMail = @mail($recipient_email, $subject, $body, $headers);
Ouput Mail is:
8de2a431c506316063ec3a4044192e46
PGh0bWw+PGJvZHk+PHN0cm9uZz5EZWFyIFNpci9NYWRhbSw8L3N0cm9uZz4gPGJyIC8+DQo8YnIg
Lz4NCgkJIEluc3RydW1lbnQgOiBHQy8wMiwgc2VyaWFsX251bWJlciA6IEMxMjA5NTMwMjQ2Nywg
bWFrZSA6U2hpbWFkenUgIG1vZGVsIDpHQyAyMDEwIFBsdXMtIEluc3RydW1lbnQgaXMgYnJlYWtk
b3duIFBsZWFzZSBhbGxvdCBzZXJ2aWNlIFBlcnNvbiA8YnIgLz4NCjxiciAvPg0KQmVzdCBSZWdh
cmRzPGJyIC8+DQpBZG1pbiw8YnIgLz4NCiAgQWRtaW4sPGJyIC8+DQpWaW10YSBMYWJzIExpbWl0
ZWQuPC9ib2R5PjwvaHRtbD4=
php centos sendmail
php centos sendmail
New contributor
New contributor
edited Nov 21 at 7:33
Dhaval Simaria
87511425
87511425
New contributor
asked Nov 21 at 7:24
Ravindra
12
12
New contributor
New contributor
Please add the actual code of the email message you receive to the question, that probably is invalid so needs to be checked.
– arkascha
Nov 21 at 7:34
Above mentioned code is the actual code and getting encrypted format message to receivers side. if I add any attachment to mail that attachment is also encrypting.
– Ravindra
Nov 21 at 7:41
That does not look like something "encrypted", more like base64 encoding. But more important: that certainly is not the message code. That might be what you see in some email program, but that is something different. To understand what is wrong with your message you need to debug the code you send out, that is why I asked for it. Most email programs offer some feature like "View source code" or similar for received messages.
– arkascha
Nov 21 at 7:58
add a comment |
Please add the actual code of the email message you receive to the question, that probably is invalid so needs to be checked.
– arkascha
Nov 21 at 7:34
Above mentioned code is the actual code and getting encrypted format message to receivers side. if I add any attachment to mail that attachment is also encrypting.
– Ravindra
Nov 21 at 7:41
That does not look like something "encrypted", more like base64 encoding. But more important: that certainly is not the message code. That might be what you see in some email program, but that is something different. To understand what is wrong with your message you need to debug the code you send out, that is why I asked for it. Most email programs offer some feature like "View source code" or similar for received messages.
– arkascha
Nov 21 at 7:58
Please add the actual code of the email message you receive to the question, that probably is invalid so needs to be checked.
– arkascha
Nov 21 at 7:34
Please add the actual code of the email message you receive to the question, that probably is invalid so needs to be checked.
– arkascha
Nov 21 at 7:34
Above mentioned code is the actual code and getting encrypted format message to receivers side. if I add any attachment to mail that attachment is also encrypting.
– Ravindra
Nov 21 at 7:41
Above mentioned code is the actual code and getting encrypted format message to receivers side. if I add any attachment to mail that attachment is also encrypting.
– Ravindra
Nov 21 at 7:41
That does not look like something "encrypted", more like base64 encoding. But more important: that certainly is not the message code. That might be what you see in some email program, but that is something different. To understand what is wrong with your message you need to debug the code you send out, that is why I asked for it. Most email programs offer some feature like "View source code" or similar for received messages.
– arkascha
Nov 21 at 7:58
That does not look like something "encrypted", more like base64 encoding. But more important: that certainly is not the message code. That might be what you see in some email program, but that is something different. To understand what is wrong with your message you need to debug the code you send out, that is why I asked for it. Most email programs offer some feature like "View source code" or similar for received messages.
– arkascha
Nov 21 at 7:58
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Ravindra is a new contributor. Be nice, and check out our Code of Conduct.
Ravindra is a new contributor. Be nice, and check out our Code of Conduct.
Ravindra is a new contributor. Be nice, and check out our Code of Conduct.
Ravindra is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53407090%2ffrom-windows-system-mails-is-sending-fine-but-after-hosting-into-centos-mail-is%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Please add the actual code of the email message you receive to the question, that probably is invalid so needs to be checked.
– arkascha
Nov 21 at 7:34
Above mentioned code is the actual code and getting encrypted format message to receivers side. if I add any attachment to mail that attachment is also encrypting.
– Ravindra
Nov 21 at 7:41
That does not look like something "encrypted", more like base64 encoding. But more important: that certainly is not the message code. That might be what you see in some email program, but that is something different. To understand what is wrong with your message you need to debug the code you send out, that is why I asked for it. Most email programs offer some feature like "View source code" or similar for received messages.
– arkascha
Nov 21 at 7:58