我正在尝试使用包含嵌入式图像的Java发送电子邮件。 问题是,从电子邮件预览中,Outlook向我显示邮件具有附件,如here
我将附件添加到电子邮件中,如下所示:
export default class ExportReportRoomSelectionModal extends React.Component {
constructor(props) {
super(props);
const roomOrder = configContext.value.roomOrder;
this.state = {
rooms: roomOrder,
selectedRooms: []
};
this.onSelectRooms = this.onSelectRooms.bind(this);
}
onSelectRooms = (e) => {
const { selectedRooms } = this.state;
const { id } = e.target;
//remove room
if(selectedRooms.includes(id)) {
this.setState({
selectedRooms: selectedRooms.filter((name) => name !== id)
});
//add room
} else{
this.setState({
selectedRooms: [...selectedRooms, id]
});
}
}
render() {
return (
<Modal}>
<Modal.Header closeButton>
<Modal.Title>Print PDF</Modal.Title>
</Modal.Header>
<Modal.Body>
<p>Number of rooms: {this.state.rooms.length}</p>
<p>Rooms:</p>
<Grid fluid={true}>
<Row className="show-grid">
{ this.state.rooms.map((roomName, i ) =>
<Col key={i}>
<Panel onClick={this.onSelectRooms} className={this.state.selectedRooms.includes() ? 'bg-success' : ''}>
<Panel.Heading id={roomName}>
{roomName}
</Panel.Heading>
</Panel>
</Col>
)}
</Row>
</Grid>
</Modal.Body>
<Modal.Footer>
</Modal>);
}
}
电子邮件结果正常,隐藏了附件并且正文中有图像,但是Outlook继续向我显示带有attach的电子邮件