c# - Gmail Inbox view after using MVC -


i have creating mvc5 projects. in project part have email send. have finished email send gmail inbox. want show inbox gmail using mvc. have below code using email send

public actionresult contactus(mailmodel objmodelmail, httppostedfilebase fileuploader) {     if (modelstate.isvalid)     {         string = "email"; //example:- sourabh9303@gmail.com         using (mailmessage mail = new mailmessage(from, objmodelmail.to))         {             mail.subject = objmodelmail.subject;             mail.body = objmodelmail.body;             if (fileuploader != null)             {                 string filename = path.getfilename(fileuploader.filename);                 mail.attachments.add(new attachment(fileuploader.inputstream, filename));             }             mail.isbodyhtml = false;             smtpclient smtp = new smtpclient();             smtp.host = "smtp.gmail.com";             smtp.enablessl = true;             networkcredential networkcredential = new networkcredential(from, "password");             smtp.usedefaultcredentials = true;             smtp.credentials = networkcredential;             smtp.port = 587;             smtp.send(mail);             viewbag.message = "sent";             return view("contactus", objmodelmail);         }     }     else     {         return view();     } } 

and view code email send

<div class="mail-box">      @using (@html.beginform("contactus", "contactus", formmethod.post, new { @id = "form1", @enctype = "multipart/form-data" }))     {         <div class="mail-body">              <form class="form-horizontal" method="get">                 <div class="form-group">                     <label class="col-sm-2 control-label">to:</label>                     <div class="col-sm-10"> <input type="text" name="to" class="form-control" placeholder="enter email here"></div>                 </div>                 <br />                  <div class="form-group">                     <label class="col-sm-2 control-label">subject:</label>                     <div class="col-sm-10"> <input type="text" name="subject" class="form-control" placeholder="enter subject here"></div>                 </div>                 <br/>                 <br/>                 <br />                  @*@html.textboxfor(m => m.subject)*@                  <div class="form-group">                     <label class="col-sm-2 control-label">attachment:</label>                      <input type="file" name="fileuploader" />                 </div>             </form>              <div class="mail-text h-200">                 <div class="summernote">                       @html.textareafor(m => m.body, new { @class = "form-control", style = "width: 840px; height: 139px;" })                      <br />                     <br />                  </div>                 <div class="clearfix"></div>             </div>              <div class="mail-body text-right tooltip-demo">                 @html.validationsummary()                 <input type="submit" class="btn btn-sm btn-primary" data-toggle="tooltip" data-placement="top" value="send" />               </div>          </div>     } </div> 

how can show inbox after send email ? in advance


Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -