2
내 UWP 응용 프로그램에서 EmailMessage()
의 본문에 줄 바꿈을 넣을 방법을 찾고 있습니다.UWP EmailMessage linebreak/new line?
이미와 노력 "\n"
, \r\n
, Environment.NewLine
, <br>
, <br />
, 그리고 모바일 또는 둘, 바탕 화면 여부를 생략됩니다 때마다. Outlook과 Gmail을 사용해 보았습니다.
내가 VS2015 업데이트 3.
감사를 사용하고 있습니다.
편집 : 여기 내가 당신이했던 것과 같은 기사를 읽고 생각하는 코드
public static async Task ComposeEmail(string address, string messageSubject, StorageFile attachmentFile)
{
var emailMessage = new EmailMessage();
emailMessage.Subject = messageSubject;
var lineBreak = Environment.NewLine;
string body = lineBreak + lineBreak + lineBreak + lineBreak + lineBreak + lineBreak + textLoader.GetString("EmailPleaseDontCut") + lineBreak + Info.GetAllInfos();
emailMessage.Body = body;
if (attachmentFile != null)
{
var stream = Windows.Storage.Streams.RandomAccessStreamReference.CreateFromFile(attachmentFile);
var attachment = new EmailAttachment(attachmentFile.Name, stream);
emailMessage.Attachments.Add(attachment);
}
emailMessage.To.Add(new EmailRecipient(address));
await EmailManager.ShowComposeNewEmailAsync(emailMessage);
}
전자 메일 용 코드를 모두 게시 할 수 있습니까? 방금 며칠 전에 \ r \ n으로이 작업을 수행했으며 잘 작동합니다. –
안녕하세요 @AnthonyRussell! 위의 코드를 살펴보고 잘못된 점을 알려주십시오. 감사. –
String Builder를 사용하고 Environment.NewLine을 추가하지 않는 이유는 무엇입니까? – AVK