send message to all email adresses of a table in a view - El Forum - 05-15-2013
[eluser]Unknown[/eluser]
Hello,
i hope somebody can help me:
i have a table in my view:
Code: <?php echo form_open('sektionssprecher/sendemail')?>
<table >
<thead>
<tr>
<th>Benutzername</th>
<th>Vorname</th>
<th>Nachname</th>
<th width="200"> Email</th>
</tr>
</thead>
<tbody>
<?php foreach ($users as $member): ?>
<tr>
<td><?php echo $member->display_name ?></td>
<td><?php echo $member->first_name ?></td>
<td><?php echo $member->last_name ?></td>
<td><?php echo mailto($member->email) ?></td>
</tr>
<?php endforeach ?>
</tbody>
</table>
<?php echo form_button('sendemail','send message to all'); ?>
<?php echo form_close() ?>
Now i want to read out all the emailadresses of this table and send it to the controller "sektionssprecher":
with "public function sendemail()" i want to send the data to a new view, where i can write my text and send it via button to all the emailadresses from this table:
Code: <?php
echo form_open();
echo form_textarea();
echo form_button('sendemail','send message to all');
echo form_close()
?>
Can somebody pls help me??
sorry for my bad english...
send message to all email adresses of a table in a view - El Forum - 05-15-2013
[eluser]j0se[/eluser]
IMHO I do all in one task:
In the view:
Code: <?php echo form_open('sektionssprecher/sendemail')?>
<table >
<thead>
<tr>
<th>Benutzername</th>
<th>Vorname</th>
<th>Nachname</th>
<th width="200"> Email</th>
</tr>
</thead>
<tbody>
<?php foreach ($users as $member): ?>
<tr>
<td><?php echo $member->display_name ?></td>
<td><?php echo $member->first_name ?></td>
<td><?php echo $member->last_name ?></td>
<td><?php echo mailto($member->email) ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php echo form_textarea();?>
<?php echo form_button('sendemail','send message to all'); ?>
<?php echo form_close() ?>
In controller:
Code: foreach ($users as $member):
$this->email->from('[email protected]', 'Your Name');
$this->email->to($member->email);
$this->email->subject('SUBJECT YOU CAN PASS IT FROM INPUT TEXT ');
$this->email->message($this->input->post('TEXTAREA VALUE');
$this->email->send();
endforeach;
send message to all email adresses of a table in a view - El Forum - 05-15-2013
[eluser]Unknown[/eluser]
hey, thank you for helping me
now i did it with your solution but when i´m using Code: show_error($this->email->print_debugger())
i get this error message:
Code: An Error Was Encountered [ 500 ]
220 mx.google.com ESMTP l6sm5224127eem.9 - gsmtp
hello: 250-mx.google.com at your service, [89.14.207.199]
250-SIZE 35882577
250-8BITMIME
250-AUTH LOGIN PLAIN XOAUTH XOAUTH2
250 ENHANCEDSTATUSCODES
lang:email_smtp_auth_pw
lang:email_send_failure_smtp
User-Agent: CodeIgniter
Date: Wed, 15 May 2013 19:15:13 +0200
From: "Your Name"
Return-Path:
To: [email protected]
Subject: =?utf-8?Q?SUBJECT_YOU_CAN_PASS_IT_FROM_INPUT_TEXT_?=
Reply-To: "[email protected]"
X-Sender: [email protected]
X-Mailer: CodeIgniter
X-Priority: 3 (Normal)
Message-ID: <[email protected]>
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="B_ALT_5193c2a1822db"
This is a multi-part message in MIME format.
Your email application may not support this format.
--B_ALT_5193c2a1822db
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Hallo steffen,
--B_ALT_5193c2a1822db
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Hallo steffen,
--B_ALT_5193c2a1822db--
but i don´t understand it.
send message to all email adresses of a table in a view - El Forum - 05-16-2013
[eluser]j0se[/eluser]
its sounds that email settings its wrong...
in google "gmail + codeigniter" the first result look the config settings
|