Note that there are some explanatory texts on larger screens.

plurals
  1. PONotice: Undefined property: stdClass: error
    primarykey
    data
    text
    <p>I am trying to fetch an email body and send a reply to the learner based on it. But i am getting an error <code>Notice: Undefined property: stdClass::$subject</code> while executing my code. I am really lost not knowing what to do. I am posting the code below. </p> <pre><code>&lt;?php $server = '{imap.aaa.com:993/imap/ssl}INBOX'; $username = 'aaa@bbb.com'; $password = 'aaaaaa'; require_once '../swift/lib/swift_required.php'; $connection = imap_open($server,$username,$password) or die('Cannot connect to Gmail: ' . imap_last_error()); $result = imap_search($connection,'ALL'); if($result) { $output = ''; rsort($result); foreach($result as $email_number) { $overview = imap_fetch_overview($connection,$email_number,0); $message = imap_fetchbody($connection,$email_number,2); $output.= '&lt;div class="toggler '.($overview[0]-&gt;seen ? 'read' : 'unread').'"&gt;'; $output.= '&lt;span class="subject"&gt;'.$overview[0]-&gt;subject.'&lt;/span&gt; '; $output.= '&lt;span class="from"&gt;'.$overview[0]-&gt;from.'&lt;/span&gt;'; $output.= '&lt;span class="date"&gt;on '.$overview[0]-&gt;date.'&lt;/span&gt;'; $output.= '&lt;/div&gt;'; $output.= '&lt;div class="body"&gt;'.$message.'&lt;/div&gt;'; if ($message == signup) { $transport = Swift_MailTransport::newInstance(); $mailer = Swift_Mailer::newInstance($transport); $message1 = Swift_Message::newInstance('new message') -&gt;setFrom(array('aaa@aaa.com' =&gt; 'name')) -&gt;setTo(array('bbb@aaa.com')) -&gt;setBody($message); $mail = $mailer-&gt;send($message1); } } } else { echo "false return"; } ?&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload