문제

I am reading mails from a pop3 server with imap and decoding them with a mailparse class which uses PEAR Mimedecode.

I was wondering if there's any way to get the signature or just to remove it from the body of the mail.

Thanks.

도움이 되었습니까?

해결책

The signature is part of the body, so no, there isn't really a way to just remove the signature, unless you knew that every signature was going to have the exact same format.

If you knew that every signature was going to come after 10 hyphens, like this

Lorem ipsum lorem ispum.Lorem ipsum lorem ispum.Lorem ipsum lorem ispum.
Lorem ipsum lorem ispum.Lorem ipsum lorem ispum.
----------
Your Name

If that is the case, then you could just do

$message = explode('----------', $body);

Where $message[0] would be the body, and $message[1] would be the signature.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top