FAQ Database Discussion Community

NilClass error setting up mailer

I'm trying to set up a mailer for the first time. I've followed the RubyGuides Mailer Basics to the letter, or so I thought. I keep getting a NilClass error. Originally, it was because my email address wasn't saving to the DB (left if off of the controller). Now I'm...

How to send a mail by postfix mail server with rails?

On my local host, I followed this article made a mail server and it works well. https://www.digitalocean.com/community/tutorials/how-to-install-postfix-on-centos-6 I want to develop a mailer feature with rails framework. Here are my settings: # mailer config.action_mailer.default_url_options = { :host => 'example.com' } config.action_mailer.delivery_method = :smtp config.action_mailer.smtp_settings = { address: 'localhost', port: 25,...

Ruby Mailer: Wrong number of arguments

I'm working on building out my mailer, but I keep running into: wrong number of arguments (0 for 1) Call my crazy, but I feel like I defined everything correctly: Controller (truncated for brevity): def create @cms484 = Cms484.new(cms484_params) respond_to do |format| if @cms484.save SendLink.message(@cms484).deliver_later format.html { redirect_to cms484s_path, notice:...

How to exclude guest users from getting emailed Rails 4 Devise

Just set up my first mailer on Rails 4. I have a welcome email sent to new users as soon as they sign up (create) for a new account using devise. I also have devise set up so that if a current_user is not found, a guest user will be...

Yii2 - mailer - send message to email rows in database

Greetings, i need to send email to several recipients that are stored in a table named mail which has a field called email. In my controller i created an action that Query the table mail for the emails. Later i tried to use the implode() function separated by comma, but...

How to change setFrom in symfony2 mailer from defoult to setted in form fields

After filing form and submit in recieving emails, field 'from' is always default setted from parameters.ymn instead of typed in form field $message = \Swift_Message::newInstance()->setFrom(array($Register->getEmail() => $Register->getName())) I use gmail.

phpmailer prints long list of details (CLIENT -> SERVER) when sending email

I have got a script working with PHPMailer. When i run it to send an email, the PHPMailer send the email successfully. But ALSO echo long list of email sending information (CLIENT -> SERVER) like: SERVER -> CLIENT: 220-server.mywebsitese.com ESMTP Exim 4.84 #2 Tue, 27 Jan 2015 08:37:57 +0200 220-We...

Sending a confirmation email without creating a model/controller and use of a db?

I've created a single page landing site which contains a simple waitlist form that dumps the info into a google doc (trying to keep it low tech for now, since an app will be built on top of this as well). I'm trying to send the people who submit their...

Efficient way of organizaing mail sending from Rails app

I have an Rails 4 application with ruby 2.1.2 that runs on a VPS with 512 mb of RAM and want to know what are the ways of efficiently managing email notification with background job with the least possible additional background processes ( like Redis and Sidekiq, each of them...

How to send multiple email with cc using Codeigniter?

I need to send email to multiple users provided with cc using CI. My code is as shown below: This below code worked for sending email for single user but i need to send same message to multiple user at a same time.. $this->load->library('email', $config); $to = 'User email address...

Slim - Swift Mailer on the route is work but if after moved on controller get errors

I add libraries slimcontroller and swift mailer in my slim project, when in route goes well: Route::get('/send', function() use ($app, $mailer) { $message = Swift_Message::newInstance('Activation Code') ->setFrom(array('[email protected]' => 'xxx')) ->setTo(array('[email protected]' => 'xxxs')) ->setBody('Test'); // Send the message $results = $mailer->send($message); // Print the results, 1 = message sent! print($results); });...