I created a simple mailing list system for an application using the Personalized Mailer spark.
This spark uses codeigniter email class to connect to the smtp server and send mails.
The problem is that the server i'm working on uses a proxy to connect to internet so when i tested the mailing list it didn't work despite that it worked when i tested it on my local server.
Is there a way to modify the codeigniter email class to support connecting to smtp server using a proxy?
Ok, to send the email your server have to make a tunnel through fsockopen and then use this tunnel to connect to SMTP. I can't specifically tell you what changes you have to made in codeigniter class but i do know a class which can send email via HTTP PROXY
http://www.phpclasses.org/package/14-PHP-Sends-e-mail-messages-via-SMTP-protocol.html
and following is a test script in which there is an option to configure the proxy.
http://www.phpclasses.org/browse/file/31.html
In case if you are wondering how this is done and wan't to populate the same logic in codeigniter class, you probably have to first read through lines 884 - 953 of file smtp.php.
In my opinion, instead of mimicking the code of this class onto codeigniter mail class, you should use this class instead and change the Personalized Mailer code(which will be comparatively little effort) to use this class.
Related
How do I send an email to my exchange server? When I set the php.ini file with send_from="x#domain.com" it says 550 verification failed. How do I verify myself?
I am using SMTP: mail.domain.com
Its probably a good idea to use a class like phpmailer http://sourceforge.net/projects/phpmailer/ to do this.
That way if you have multiple projects that need to send via a different account or different servers then you won't have any problems.
The error you're getting is because your exchange server requires authentication and your script isn't using authentication or its using the wrong information. I've never really relied on the built in php sendmail functions so I can't be 100% sure but I don't think it supports authentication. (I might be wrong on that point, but I still recommend a class that you can configure per script over a globally configured mail account)
I had written a program (In Android, client side and PHP, server side) to upload a file to a server over HTTP. Due to various reasons I had to change the system to do everything in SSH (for security among other things).
I have the basics set up (using jsch on Android). But I want to implement the equivalent of the PHP mail() function. When the file is uploaded, originally my PHP file automatically sends a mail from the server to a certain address.
I'm struggling to find a way to implement this within a shell on the server. So the question is, how do I automatically send an email from server in SSH?
EDIT:
Forgot to mention server is CentOS.
SSH itself has no mail function - it only supports shell access (which might include X and SSH agent forwarding), file transfer (or other subsystems that might be integrated into the server) and port forwarding.
So, you have basically these options:
Call some server-side shell command that causes the mail to be sent, as mentioned in the comment from Marc.
This would use a shell channel.
Use port forwarding to access an SMTP server on your server host (or any host that accepts mail from there).
If you want to send from the same program which uses JSch, there is no need to actually do client-side
port forwarding, instead simply use a direct-tcpip channel, and set its host and port properties
before connecting.
Then you'll have to implement the SMTP protocol yourself, or use any other library which supports SMTP. (I suppose JavaMail can do this, but I didn't explore how you can configure it to use JSch as a tunnel.)
Hi I am running MAMP on my mac to locally host a website. I want to send an email using php scripts. The stuff i looked online tells me about php scripts for emails but i am unable to send emails. I am guessing this has to do with MAMP settings or maybe i have to make changes to php.ini file but i cant find information regarding that. Can i send emails to my clients using my gmail address running php scripts. I am creating a signup page where once you signup successfully, the site sents you a welcome email. Can some body please guide me how to do this. I have used code from here:
http://email.about.com/od/emailprogrammingtips/qt/PHP_Email_SMTP_Authentication.htm
but this doesnt work.
i have used following settings:
$host = "ssl://smtp.gmail.com";
$port = "465";
MAMP is just Apache, MySQL and PHP and doesn't include a mail server. You could use postfix or, as you said, an external SMTP server.
If using Gmail make sure your account is setup to allow SMTP connections (it's off by default). This can be found somewhere in Settings in the web client. I'd recommend you test it with Mail or another mail client on your local machine to make sure Gmail is working as expected.
Finally (once the above is set up) SwiftMailer or PHPMailer are good mail libraries which can connect to remote SMTP servers. It'll save you a lot of headaches writing your own code, especially when it comes to file attachments and such.
I am developing a simple webmail client for IMAP-based email services using PHP's IMAP library, and I was wondering if there was any way to specify the SMTP server to use when sending an outgoing message, so that the message will be placed in the user's Sent mailbox when they are logged into their IMAP account. I saw that their is an imap_mail() function however it looks from the docs like it is just basically an alias for the normal mail() function, or am I wrong in assumming that?
Why don't you use a full featured class for this function, like PHPMailer?
Saving a copy to the Sent Mail folder is a function of IMAP, and is completely unrelated to queuing the message for delivery via SMTP. I.e., your code will have to do both operations separately -- one does not imply the other.
I have noticed that Gmail adds a copy to the sent folder on its own. Is this common behavior for the big web-mail providers?
I'm coding in PHP w/ CodeIgniter and I'd like to test some of the features in my app that send emails.
For some reason, I couldn't send emails through my email account in my local server (XAMPP), and I also don't want some SPAM filter to think I'm spamming while I'm testing.
So is there any email service that I can use for testing purposes? preferably one that doesn't enforce SSL, since I have problems getting that to work on my local server.
Appreciate your help.
As long as you're not sending out dozens or hundreds of test E-Mails, use whatever your everyday E-Mail provider is (e.g. GMail). Set the SMTP server of your mailing function to point to Google's. (I think SSL is optional with GMail, but I may be wrong.)
If your mailing library doesn't support using an external SMTP server, switch to a different one. But I think CodeIgniter has you covered there.
If you just want to test the application functionality, check out Papercut. This utility simulates the sending of email without having to set up a mail server, works great!
edit: had wrong link.
I like to set up a test SMTP service on my development machine and just send to that. There are several good options listed under this question.