I have a web application, written in PHP, where we have a couple of files that regularly needs to be sent to multiple recipients. The client wishes to have the mail conversation in their mailbox, so the web app should not send the e-mails itself. Is it possible, and if so how, to do the following:
Create an e-mail with multiple recipients
Add text to the subject and body of the e-mail
Download and attach a zip file which is available on the server
The mail client in question is Outlook - I'm unsure of the exact version.
I'm open to suggestions on which technology to use for this - the client mentioned Visual Basic but I'm unsure of how I could use that on the client side of the web app - or if it's even appropriate.
Assuming that the client want's to send that by hand, you can do all that by using the mailto: in an tag and "&attachment=". The only problem is that attached files need to be localy accessable. If they are not, they are not attached. Exact syntax specifications can be found here: mailto: Syntax
If you have imap access to the customers mail server you could use php imap mail and php imap mail compose to create a email which will just show up in your customers sent email folder.
Also I there is a MIME Message class, where the author claims that it can create and save an email as an .eml file. MIME Class
This is theoretically possible, but only with IE on the client side, and with other limitations and tribulations.
How about a different approach: Have the web server send out the E-Mail, and send a copy into the client's mailbox. Mark the copy with a special header or something, and add a rule in the client's Outlook to sort mails with that header into a specific folder.
Related
My iOS application uses Mailcore to access a user's email account. Sending and receiving is done via SMTP and IMAP, and both processes work as expected for Gmail and Outlook (which both use OAuth for login).
I just added Yahoo (as well as some other providers to the app who do not use OAuth) and for all of these providers I am having an issue specifically with sending messages.
The issue is that although messages DO get sent successfully from my application, they do not appear in the sent folder on the web for the provider.
For example, if I log into my Yahoo account in my application, and send a message to my Gmail account, the message appears in my Gmail inbox on the web, but not in my Yahoo sent box on the web.
I tried adding Yahoo to the regular mail app on iPhone and sending a message from this account - this worked fine - the message shows up Yahoo sent box on the web. So, I then compared the headers of the two messages (the one sent from mail app and the one sent from my app) and the only obvious difference I see is in the line 'X-Rocket-Received':
Mail App:
X-Rocket-Received: from [11.180.250.219] (userName#71.208.72.234 with xymcookie [216.39.61.254])
by smtp203.mail.ne1.yahoo.com with SMTP; 23 May 2014 08:19:54 -0700 PDT
My App:
X-Rocket-Received: from (userName#118.41.27.139 with plain [98.138.105.21])
by smtp214.mail.ne1.yahoo.com with SMTP; 23 May 2014 08:58:29 -0700 PDT
Can anyone answer any of the following questions for me:
1) What does X-Rocket-Received mean?
2) What is the significance of "with xymcookie" versus "with plain"?
3) Is my issue likely to do with my not having an xymcookie?
4) Where might I begin to solve this issue?
Many thanks.
Additional information:
It was placed there by some server along the way. It is a non-standard header. It appears similar to a standard SMTP Received header though.
'xymcookie' is a non-standard authentication method used by Yahoo. It is not, as far as I can tell, publicly documented.
No.
See Remy's answer. Use IMAP Append for most servers. Gmail does not require it, but that is non-standard.
Sending an email with SMTP directly does not put the email in the provider's Sent folder. You have to log into the provider with IMAP and put a copy of the email into the Sent folder as a separate operation. Higher level apps, like iPhone's mail app, handle these details internally.
Usually, when you send an e-mail (with Thunderbird or Outlook), you don't send it directly.
example: I have a gmail address and I want to send an e-mail to a myopera address. The process will be:
user->gmail server(gmail-smtp-in.l.google.com)->myopera server(in1.smtp.messagingengine.com)->final user who'll download it's email with pop/imap.
One of the inconvenient is the size: Imagine you have attachment of 50Mb: the limit of myopera is 60MB; but the limit of gmail is 25MB,So the mail will be refused whereas it would be accepted if it was send directly to myopera.
But I saw with telnet that, it is possible to send mail directly with SMTP commands.
I want to write a client-side Only web application which would convert a mail in a set of SMTP commands for sending it. I should be very basic and not support encryption
I don't know how to create a TCP connection from a client, so, here's my questions: Does a library already exist? If not, what I should use? I've read about the existence of WebSockets but that Ajax would be more universal.
Also, most of the actuals implementations of WebSocket I saw, don't work in my latests versions of web browser despite the fact they 'support it'. There's also the raw Socket API from the W3c (I've no idea of the web browsers which actually support it).So, I would like to not avoid statements telling it is impossible to create near raw TCP/UDP session. Since it is possible, I can't imagine nobody created a kind of library for dealing with protocols
You should take an alternative route.
If i had that issue i would still use a server side component of some sort, and just have the server contact to receiving mail server directly.
Given the email: "someuser#somedomain.tld" you could do a DNS MX record lookup on "somedomain.tld" and find the receiving mail server say "mail.somedomain.tld", then you could tell your mail send component to send the email directly to "mail.somedomain.tld", that way you would have an immediate feedback on whatever the mail went through or not.
For Objective-C you may use https://github.com/jetseven/skpsmtpmessage
By looking at the source you see how SMTP works.
I would like to know if it's possible to provide an email certificate (signed by a recognised CA) so the user clicking on the mailto link can send encrypted email to the owner of the cert ?
hello#gmail.com
Is there any way to do that using the mailto link or using some JS ? Given the mailto link is handled by a local email client, should be possible ?
If there is no direct way to do this, how to make it?
One option is a web form for message sending, served via HTTPS. The server-side handler of the form would compose an encrypted mail on the server and then send it via SMTP. This provides almost the same level of security as direct encryption (given that your server is secure). Unfortunately there's no other simple way to do what you want. Of course, you can put a link for your .cer file download and tell the user to download the .cer file and use it to compose an encrypted mail, but how would you deal with GMail users and mobile users? Web form is more flexible and easier to use for the sender.
You can look up what you according to the current specification can do with a mailto URL in RFC 2368. You'll see that it only refers to the construction of the mail text and headers, not their encoding or encryption. There may be extensions for some mail clients, but that's not something one should generally count on.
Furthermore, Web mail users generally will have problems with such links anyways. Thus, for a solution that has to be usable by anyone, a scheme counting on some client side program is not a good choice.
Thus, some Web form as mentioned by #Eugene accessable only via https would best serve your requirements.
I create small form (Name, email, Subject, Message) in Flash. Want to send this by email using AS3 code.
Can we use this offline? Like, we fill all the detail and after submit then its go online and receive the detail in email
as #esimov said, security is not major concern then you have to use SMTPMailer, because your mail send in pure text form to the e-mail server. but if you want to use SMTPMailer then you can use some encryption and decryption method in it. This encryption packet with key are traceable. so If security is major concern then you must use airxmail written in actionscript so you can send and receive mail with SMTP, POP3, IMAP4 protocol. best example are given to send and recieve a mail.
May this will help you.
If you want to use an email client directly using Flash technology you need to stick with Flex. It has a robust backend interaction and even more it allows to do some cross scripting interactions.
However if you wish to use Flash and not Flex, actually there is an email sending application called SMTPMailer which sends attached files through emails with the Socket class available in the Player 9 and AS3. Please note, that for security reason is always better to send emails from the server side of the application. So another possibility would be to integrate the email sending part in a server side script.
Is it possible to retrieve the SMTP response of a mail. For example, I am sending a mail to non existing email id. Surely our server will send us a mailer daemon failure mail to our mail id. I need to capture that failure mail.
How its possible? please explain me. Some time we may enter more than one non existing email id, so i have to retrieve all the failure mail alone for every corresponding emails
Please guide me!
Thanks in advance,
Praveen J
I think I understood your question correctly now. As I understand, you are writing an application to send mail. And in your application, whenever you send a mail, you also want verify that if mail was delivered and also if it was not delivered then you want to get hold of the failure message in your application. Is that how you mean?
Well, if that is how you mean, then I think it is impossible to track the mail status with your apllication code. For instance if you are using java sendMail in your apllication you can only ensure that the send happened from your code successfully(without any send exceptions like java.net.SocketException or javax.mail.MessagingException). But, you can never ensure if the mail really reached the recepient. i.e. you can never track in your application if the mail was rejected due to wrong recepient address or any other error like illegal attachment at receipient mail server or errors like blocked sender id etc.
That is because any such error condition will be communicated by the receipient mail server to the sending mail server the information of which is present in the sent mail's header.
Does that answer your question? (Or did I understand your question correctly? ;-))
I am not sure if I am getting your question right. If you send an email to any non existent address say xxx#gmail.com from your address yyy#yourhost.com, the mail server at gmail.com replies to the mail server at yourhost.com with failure message and reason, with your delivery address and you receive the fialure mail automatically. you don't have to do anything extra in this.
If you are talking about seeing mail headers, then it depends on which client you are using. For instace, if you are using MS outlook, you can right-click on the message and click options and then see internet headers section to get mail headers. If you are using some web based mail then i am sure there will some option to view detailed mail headers.
The bounced messages are going to return to a mailbox. You should be able to configure that mailbox by properly setting the headers on the messages you send out. You would then need to monitor that mailbox, or have that mailbox deliver the messages to your program.
I would suggest you consider using VERP for all messages you send out. It will make it much easier for you to identify which email address a particular bounce belongs too. To do this you would need control of your mail server though. It takes some work configuring things.
To answer the question with more detail you need to tell us how your are sending messages, what type of mail server you are running, and how much control you have over the mail server.
On Unix, you can use "procmail" for this. Procmail is a service which can intercept your mails and process them following rules.
If you can access your mail my IMAP, I suggest to look at the Python module imaplib.