我的网站是使用 React 编写的。我希望网站是静态的,这样我就可以将它放在 Github 上并使用 Netlify 托管它。
下面的代码是我的电子邮件表格。目前我正在使用一个 php 脚本。我想更改它以使我的网站静态化。我真的只是想知道我必须将操作更改为在线action='./php/sendEmail.php'
,以便我不再需要使用 php 并且可以访问我的 sendinblue 帐户(我听说它在一定程度上是免费的,所以这就是为什么我想通过 mailgun 使用它)并向我的电子邮件地址发送电子邮件。
var Field = (props) => {
return (
<input id={props.id} className={props.className} aria-invalid="false" name={props.name} placeholder={props.name} data-aid={props.dataAid} type={props.type} onChange={(e) => dispatch(editValue(e.target.value,item.id)) }></input>
)
}
Field.defaultProps = { type: 'text'}
var EmailForm = (props) => {
return (
<div className="form" data-state="desktop left" data-dcf-columns="4">
<form action='./php/sendEmail.php' method="post" role="form" aria-label="contact form" className="form_style-wrapper" encType="multipart/form-data">
<Field id='field1' name='Name' dataAid='nameField' className='field_word required' />
<Field id='field2' name='Email' dataAid='emailField' className='field_word required' />
<Field id='field3' name='Phone' dataAid='emailField' type='hidden' className='field_word' />
<Field id='field4' name='Subject' dataAid='subjectField' className='field_word' />
<textarea name="Message" className="message" placeholder="Message" data-aid="messageField"></textarea>
<button className="sendButton" type="submit" name="submit" value="Send">Send</button>
</form>
</div>
)
}
EmailForm.defaultProps = {
action: 'handleSubmit'
}