I want to send emails from my application by using Windows Mail App. MS offers EmailManager for this, which allows sending messages in HTML format but `EmailManager have an issue related to working with HTML API.
After researching for understanding what is the issue, I find these articles
Does the Win 10 UWP EmailMessage API support having an HTML body?
EmailMessage with EmailMessageBodyKind.Html
I began to use the features of the Manager`
private async void SendByEmail(StorageFile file , string text)
{
var emailMessage = new EmailMessage();
emailMessage.Attachments.Add(new EmailAttachment(file .Name, file ));
emailMessage.Body = text;
await EmailManager.ShowComposeNewEmailAsync(emailMessage);
}
but it does not match my requirements.
Are there other ways in UWP to send emails using Windows Mail App?
UWP has no other mail API, and does not support html preview.
The EmailManager.ShowComposeNewEmailAsync, and
EmailManagerForUser.ShowComposeNewEmailAsync methods won't recognize
an HTML formatted body. You can only use those methods to send email
in plain text.
You can try to send mail with HTML format through .net API in namespace System.Net.Mail.
Related
I have a Xamarin Forms app, for Android and iOS, which is using FirebasePushNotificationPlugin by CrossGeeks.
I am using Amazon SNS and Firebase for the messaging.
I can send messages to both the Android and iOS apps by using the Firebase console. I am now trying to code the send into a C# / ASP.Net website.
This is to send to a specific endpoint, rather than to a Topic.
What I'm not sure about is how to do that using Amazon SNS - AmazonSimpleNotificationServiceClient. Do I need to send specifically formatted JSON, or can I just send the message text and let Amazon sort it out?
I have tried this but it doesn't seem to be working:
PublishRequest pr = new PublishRequest
{
Message = msgContent,
TargetArn = endPoint.Arn
};
PublishResponse resp = _client.Publish(pr);
msgContent would be something like "this is my message content". the endPoint.Arn is for a specific device.
It seems to send successfully but the notification message does not appear on the phone. Does the message actually need to be a JSON formatted string, rather than plain text?
I don't seem to be able to find any examples of how to do this. Plenty of examples of how to send messages from the Firebase console though
I've looked into Marketo Email code samples and they're all always refer to either an email created and stored, or at the most, stored with tokens linked to some information related to leads. I have found nothing that satisfy a simple requirement like sending a simple email with dynamic content.
My email sender interface looks like:
interface IEmailDelivery
{
bool Send(IEnumerable<string> recipients, UserNotification notification);
}
I'm looking to implement the above interface with Marketo API, where UserNotification contains the content of the email (subject, to address, body, isHtml.. etc)
You're probably looking for this process: http://developers.marketo.com/blog/sending-transactional-emails-with-the-marketo-rest-api-part-2-custom-content/ There's currently no direct API to send an email, but this will allow customization of content
Marketo emails are intended to be used as part of a marketing campaign when nurturing customers/prospects. Marketo, unfortunately for your case, is not the best tool for the job. SMTP or a cloud based emal solution such as Azure supports or a 3rd party such as mailchimp would be better suited for your request.
But - if you want to use marketo, you can follow the link that the first responder posted (http://developers.marketo.com/blog/sending-transactional-emails-with-the-marketo-rest-api-part-1/).
We've been working on browser to phone as per the doc provided by twilio which is in C# razor. We have to same the same for our clients using asp.net4.0.
When a phone number is entered in the textbox the call gets forwarded to the number that is specified in the VoiceURL of the TWIMLAPP rather than forwarding it to the number entered in the textbox.
Below listed are some of the queries that are haunting us;
How do we create dynamic TWIML's to pass the phone number to the Dial Verb?
How to over write the VoiceURL of the TWIML app programmatically?
Are there any examples in asp.net 4.0?
Twilio evangelist here.
Lets take your questions one at a time.
How do we create dynamic TWIML's to pass the phone number to the Dial Verb?
TwiML is just XML, so there are a number of ways to dynamically generate XML in .NET. We do provide a special library (available on NuGet) called Twilio.TwiML that will generate the TwiML for you to return to Twilio. I wrote a blog post a while ago that shows you how to use it.
If you want to generate a <Dial> verb using the TwiML library, you would do something like:
var response = new TwilioResponse();
response.Dial(phoneNumber);
string xml = response.ToString();
How to over write the VoiceURL of the TWIML app programmatically?
The Twilio REST API can be used to modify a TwiML Application. The Twilio .NET helper library makes it easy to do this as well:
var client = new TwilioRestClient("[YOUR_ACCOUNT_SID]","[YOUR_AUTH_TOKEN]");
client.UpdateApplication(applicationSid, friendlyName, applicationOptions);
Hope that helps.
I'm using Google's .NET Client Library to read email on my gmail account.
But things are not very clear for me.
I'm trying to retrieve Atom feeds with this code.
FeedQuery query = new FeedQuery();
Service service = new Service("mail", "app-MailChecker-1");
service.setUserCredentials(Username, Password);
query.Uri = new Uri("https://mail.google.com/mail/feed/atom");
AtomFeed feed = service.Query(query);
It gives me a simple exception: can't retrieve feed.
My priority is to accomplish this using Google's .NET Client Library
but other options will be helpful as well.
Additional information: this method works for Google Calendar without a problem.
If you read Google's FAQ about the Google Data Protocol you'll see that it has no data API for GMail.
http://code.google.com/intl/nl-NL/apis/gdata/faq.html#GmailAtomFeed
To quote:
Does Gmail have a Data API?
No, but you can use Gmail's Atom feed with AuthSub or OAuth to request
read-only access to a user's unread messages. The scope should be set
to https://mail.google.com/mail/feed/atom/. An example query would be:
GET https://mail.google.com/mail/feed/atom/
If you're interested in managing your mail, Gmail also has IMAP/POP
support.
I experimented with version 1.9.0.0 of the Google Data .NET Client Library myself. Don't see any references to GMail.
Here's one possible approach on how to retrieve the unread messages:
http://www.dotnetcurry.com/ShowArticle.aspx?ID=292
It's similar to what Christian suggested in his comment.
I am using this library IMAPX to get emails.
I also need to send emails but cannot figure out how.
I tried using the example code:
client.Folders["INBOX"].AppendMessage(msg)
but receive an error that AppendMessage requires two arguments and I cannot figure out what the second argument should be.
Is it possible to send an email with this library and if so how?
According to Reflector, it looks like the second parameter should be a string giving the flags for the new message; it looks like the ImapFlags class gives a list of available flags.
If you want more background in IMAP, then you should read its RFC.
However, the IMAP protocol is NOT used to send mail, it's used to read or retrieve mail that's in a mailbox on a server. You can use it to add messages to your own mailbox (as you're trying to do here), but that isn't what most people mean when they talk about sending email... SMTP is the standard way to send email.