From windows system mails is sending fine but after hosting into centos mail is sending in encrypted format












0














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=









share|improve this question
























  • 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 '18 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 '18 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 '18 at 7:58


















0














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=









share|improve this question
























  • 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 '18 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 '18 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 '18 at 7:58
















0












0








0


1





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=









share|improve this question















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 21 '18 at 7:33









Dhaval Simaria

90521425




90521425










asked Nov 21 '18 at 7:24









Ravindra

12




12












  • 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 '18 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 '18 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 '18 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 '18 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 '18 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 '18 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 '18 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 '18 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 '18 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 '18 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 '18 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 '18 at 7:58



















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















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






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














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





















































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







Popular posts from this blog

Wiesbaden

Marschland

Dieringhausen