What's the function for sending e-mails from WP7? I'm trying to set up a button to send feedback e-mail, but I can't find the right function.
Thanks,
Zain
Found it. You need to use the EmailComposeTask class. Here's a sample:
using Microsoft.Phone.Tasks;
...
void SendEmail(){
EmailComposeTask email = new EmailComposeTask();
email.To = "receiver#stuff.com";
email.Subject = "hey";
email.Body = "Wazaaaaaaaaaaap! How you doin?";
email.Show();
}
Related
How can I send any screenshot captured using selenium web driver to a mail recipient?
In c# you can use
using Outlook1=Microsoft.Office.Interop.Outlook;
Add reference of Above
Outlook1.Application outlookApp1 = new Outlook1.Application();
Outlook1.MailItem mailItem = (Outlook1.MailItem)outlookApp1.CreateItem(Outlook1.OlItemType.olMailItem);
outlookApp1.CreateItem(Outlook1.OlItemType.olMailItem);
mailItem.Subject = "Your subject";
mailItem.To = "Email id";
mailItem.Importance = Outlook1.OlImportance.olImportanceLow;
mailItem.Display(false);
mailItem.Send();
You can even add attachments
I have a requirement. I have a mail server where user sends mail with there requirement and i need to insert data in my database when mail arrive in mail box. i Have no idea about it. If anybody has any idea please share. Thanks in advance.
Please find the below codes for sending and receiving mails accordingly:
Send Mail
var message = new MailMessage("admin#bendytree.com", "someone#example.com");
message.Subject = "What Up, Dog?";
message.Body = "Why you gotta be all up in my grill?";`enter code here`
SmtpClient mailer = new SmtpClient("smtp.gmail.com", 587);
mailer.Credentials = new NetworkCredential("admin#bendytree.com","YourPasswordHere");
mailer.EnableSsl = true;
mailer.Send(message);
Recieving Mail
client.Connect("pop.gmail.com", 995, true);
client.Authenticate("admin#bendytree.com", "YourPasswordHere");
var count = client.GetMessageCount();
Message message = client.GetMessage(count);
Console.WriteLine(message.Headers.Subject);
You can use this message object for database insertion.
I am trying to reply outlook email as we do manually it goes with previous conversations. But Below code is giving some error : Failed to send to the recipient address..I need to know how i can send it back to the person who sent me email..
import win32com.client, datetime
from datetime import timedelta
outlook =win32com.client.Dispatch("Outlook.Application").GetNamespace("MAPI") # to trigger outlook application
inbox = outlook.GetDefaultFolder(6) # 6 is used for the index of the folder
messages = inbox.Items
message = messages.GetLast()# message is treated as each mail in for loop
for message in messages:
if message.Subject=="request": # based on the subject replying to email
#body_content = message.body
message.Reply()
message.Body = "shortly will be processed!!!"
message.Send()
The reply is a MailItem returned by reply(). So try this:
reply = message.Reply()
reply.Body = "shortly will be processed!!!"
reply.Send()
continuing to above answer
to reply all:
`rplyall=message.ReplyAll()`
to reflect previous conversations:
`rplyall.Body="your message here"+rplyall.Body()`
`rplyall.Send()`
Since MailItem.Body is a String and it is not callable. Reference document
I think the correct code in #Akhil 's answer is
rplyall.Body = "your message here" + rplyall.Body
rplyall.Send()
How to move mail to a new folder in outlook?
My code:
using (ImapClient ic = new ImapClient(
imapAddr,
myEmailID,
myPasswd,
ImapClient.AuthMethods.Login,
portNo,
secureConn))
{
ic.SelectMailbox("INBOX");
bool headersOnly = false;
Lazy<MailMessage>[] messages = ic.SearchMessages(SearchCondition.Unseen(), headersOnly);
foreach (Lazy<MailMessage> message in messages)
{
MailMessage m = message.Value;
}
}
I try Google it but I can not find it .
Any suggestions are highly appreciated.
to move a message to another folder do this:
ic.MoveMessage(message.Uid, "some existing folder");
The uid is the unique identifiier for the mailmessage. I assume it maps to the message-id as described in RFC for Internet Message Format. Or otherwise to the UNIQUEID in the IMAP protocol.
to create a new folder use the this method:
ic.CreateMailbox("new mailbox name");
To send emails use an SmtpClient, like the one that is supplied in the .net framework:
using(SmtpClient client = new SmtpClient("your smtp server.com"))
{
client.Send("from#example.com",
"to#example.com",
"subject",
"Hello World");
}
Could you please help me understand how to send a workflow email, when user submits a task form. The process is to automate the sending of email to "BI Owners", when user fills out a form and once he/she clicks "save"/"submit", then the email should be sent out.
Thanks in advance.
Do you need to understand the Worfklow's configuration?
In that case, check this out:
Send e-mail in a workflow
How do you build up your form? It is an aspx, a webpart, some kind of magic?
Well, this is important, 'cause you have different ways to fire up your workflow, depending on that.
If you have all the form's control, well, this is my sending emails class:
protected void sendEmail()
{
try
{
string mailTo = dudeToSendMail;
MailMessage message = new MailMessage();
message.From = new MailAddress(mailSender);
message.To.Add(new MailAddress(mailTo));
message.Subject = mailSubject;
message.Body = buildMail(); // hey, dude, build up your mail here!
message.IsBodyHtml = true;
SmtpClient client = new SmtpClient();
client.Send(message);
}
catch (System.Exception)
{
throw;
}
}
Hope it helps.