How can I send mail through Gmail with Perl? - perl

How can I send email using Perl through my Gmail account? The one CPAN library (Mail::Webmail::Gmail) that I tried didn't work and I don't see much activity with it.
At the moment I really only need to send a message. However, the advanced functionality of getting my contacts, acting when a new email is received that has a certain label, etc. certainly seems appealing for another day.

Did you try Email::Send::Gmail?

You could always send with SMTP. The server is smtp.gmail.com, it requires TLS and uses authentication. You may also have to enable POP/IMAP in your account.

I had the same problem with Mail::Webmail::Gmail, I ended up using Net::IMAP::Simple::SSL to get my mail from gmail. I'd guess if I had to try to send mail with it I would first try Net::SMTP::Server .

I have extended WWW::Contact::GoogleContactsAPI to get all the contact fields. See:
Is there a Perl module to interface to Google Contacts API?

Related

Sending emails without Mailserver

I would like to know if there is a way how I can send e-mails with preferabel php or JS without needing an actual mail server. I am pretty sure it won't work, but have any of you an idea how there could be a way?
You can send mail with a lot of services, I believe they are called 'exchange' mail services. Gmail, outlook (or live, hotmail) are examples of these services. Google is full of examples :-)

Can't receive emails send from php

I have set up several email accounts on my vps hosting but I can't receive any emails that are send via php from another hosting. Everything works fine when I send emails from gmail for example, I receive them without a trouble. Does anyone know any reason why emails sent from php can't be received?
Try using phpmailer, it's a good mailing class which automatically sets well defined headers so that the mail is more likely to not land in the spam folder.
Sounds like a spam filter issue. Have you set up a proper Sender ID/SPF framework in your domain name service so that the host appears to be a valid MTA for this domain? Look here for a detailed explanation of Sender ID/SPF/DKIM, etc.
Check your spam folder.
GMail is able to differenciate if a mail has been sent from outlook for example or an automated application. (I dont know how, but they can). If i send an email from my work account to GMAil works, if its a web app or executable with the same email adress, it ends up on the spam folder.

Securely sending email via external smtp server in cocoa touch

I'd like my app to be able to send an email, from my servers to their address, when they press a button. Seems simple enough but I can't seem to find any straightforward examples. The ones I have found use third party libraries which some people said were insecure in that someone could find a way to send their own emails through that account.
Also, would this type of thing get my app rejected? Do I have to use the built in email message window?
Thanks!
check this out: http://code.google.com/p/skpsmtpmessage/

Can I send email programmatically in iPhone app?

I need to be able to send a pre-formatted email or SMS text message programmatically from within an iphone app. Can this be done? I have looked at apple's MFMailComposeViewController class, but this "provides a standard interface that manages the editing and sending an email message" and the MFMessageComposeViewController class also has it's own "standard system interface for composing SMS text messages". These allow you to present an interface to the user where they have to fill in all the data and then explicitly press a send button.
I cannot use this boilerplate functionality.
I need to be able to send a message without presenting any interface to the user. I know this sounds evil, but actually it is for a commercial application which needs to communicate to a user group in a central office when users in the field have performed specific actions out in the field.
Has anyone found a solution to this?
After much investigation, I have found that sending emails programmatically, without user intervention, from an iphone application, cannot be implemented using any of the apple frameworks.
Set up a web service you can post to using an HTTP request. If you are posting to only one address this can work very well, although you may want to get the user to input their return mail address.
Otherwise only the standard dialog is available (this relies on using whatever account they've setup on the device).
Here are a few SMTP API's that work on OS X. They might work on iOS as well.
Pantomime
MailCore
EdMessage
Only Possible via Web Interface, you can not hide the Interface , this is as per apple Guidlines to Developer and as per documentation
Looking for a solution to such a problem, I found something interesting here: How to send mail from iphone app without showing MFMailComposeViewController?
I hope this will be useful!
This is standard not possible. If you can't use the standard dialog you need to use SMTP.
SMS is the same, use the dialog of use a webbased sms service (most of these cost some money).
I have no experience with iOS, but I have enough experience with email protocols to say I'd be very surprised if a client application could send email without accessing a server. More than likely, the email will be sent using the SMTP protocol and therefore must be sent using an SMTP server. Choosing how you connect to that server is about the only option you have. You could connect to a server-side script (such as php) to generate and send the email, or you may be able to create a socket and connect directly to port 25 on the SMTP server and still generate the email from you client application.
Check out:
RFC 5321 at https://www.rfc-editor.org/rfc/rfc5321
SMTP on Wikipedia at http://en.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol
You could always do a low level telnet using SMTP protocol to a known mail server to send a message. I don't know if Apple will reject the app, but SMTP is damned simple.

Anonymous SMTP Service

Does anyone know of a free, anonymous smtp service? I want to give users of my app the ability to occasionally send me an anon email without having to configure a server of enter their email account. I guess I could setup a gmail account for this purpose and embed the credentials in the app but I hope it won't be necessary. In case it sways your answer, this is a thick client (.NET Console) app.
I think that what you're asking for is called an open relay.
If there were such a thing, wouldn't it immediately be swamped by spammers?
You might be better off setting up some kind of commenting tool on your website, that sends you an email with the contents of whatever form the user submits. Then if you go that far, it shouldn't be difficult to add a form to your app that automatically makes the full HTTP request (transparent to the user, in the background).
If you run your own mail server, you can simply configure the app to deliver mail directly to it. Many web hosting companies also provide mail hosting if you don't want to run it on your own hardware. Gmail via Google Apps for your domain might be an option. It's free. But their anti-spam measures might prevent delivery. Better to have a server you can control, I think. Bottom line, though, is you don't need an anonymous SMTP relay server to get the job done.